Tiketo API reference
Welcome on API reference page. Here You can find queries/mutations for service2service integration.
Authorization
All requests to this API require an API token sent in Authorization header in format TOKEN {token}. You can obtain it in workspace detail.
Creating pass
To create new pass You need to know Project ID and Template ID (see below how to fetch list of projects/templates). You can also provide ID of a pass (so You can use Your own identifier). When pass with given ID exists, it's updated (no need to use updatePass method).
You can send following request:
curl --request POST \
--url 'https://api.tiketo.eu/graphql' \
--header 'authorization: TOKEN {YOUR_TOKEN_HERE}' \
--header 'content-type: application/json' \
--data '{"variables":{"projectId":"{PROJECT_ID}","input":{"templateId":"{TEMPLATE_ID}","parameters":"{\"firstName\":\"John\",\"lastName\":\"Doe\"}"}},"query":"mutation CreateOrUpdatePass( : ID!, : ID, : PassInput!) { createPass( projectId: $projectId, id: $id, input: $input) { share { url expiration } } }","query2":"query ($projectId: ID!,$filename: String!) { token { project( id: $projectId) { file(name: $filename) { uploadUrl } } } }"}'
API response:
You will receive create pass in response:
{"data":{"createPass":{"share":{"url":"https://...","expiration":"2021-12-31T23:59:59Z"}}}}
Fetching data
List of Projects
Project represents a group of passes. You can fetch list of projects using following query:
curl --request POST \
--url 'https://api.tiketo.eu/graphql' \
--header 'authorization: TOKEN {YOUR_TOKEN_HERE}' \
--header 'content-type: application/json' \
--data '{"query":"query GetProjects { projects { id name } }"}'
API response:
You will receive create pass in response:
{"data":{"projects":[{"id":"...","name":"..."}]}}
List of PassTemplates
Template represents a pass design. You can fetch list of templates using following query:
curl --request POST \
--url 'https://api.tiketo.eu/graphql' \
--header 'authorization: TOKEN {YOUR_TOKEN_HERE}' \
--header 'content-type: application/json' \
--data '{"query":"query GetPassTemplates { passTemplates { id name } }"}'
API response:
You will receive create pass in response:
{"data":{"passTemplates":[{"id":"...","name":"..."}]}}
Terms of Service
API Endpoints
# Production:
https://api.tiketo.eu/graphql
Headers
# Provide API TOKEN created in workspace detail
Authorization: TOKEN <YOUR_TOKEN_HERE>
Queries
eventTickets
Response
Returns [EventTicket!]!
Example
Query
query EventTickets {
eventTickets {
id
name
}
}
Response
{
"data": {
"eventTickets": [
{"id": 4, "name": "xyz789"}
]
}
}
loyaltyCards
Response
Returns [LoyaltyCard!]!
Example
Query
query LoyaltyCards {
loyaltyCards {
id
name
}
}
Response
{
"data": {
"loyaltyCards": [
{
"id": "4",
"name": "abc123"
}
]
}
}
pass
Example
Query
query Pass(
$projectId: ID!,
$id: ID!
) {
pass(
projectId: $projectId,
id: $id
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{
"projectId": "4",
"id": "4"
}
Response
{
"data": {
"pass": {
"id": "4",
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "abc123",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": true,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
passByScanCode
Example
Query
query PassByScanCode($code: String!) {
passByScanCode(code: $code) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{"code": "abc123"}
Response
{
"data": {
"passByScanCode": {
"id": 4,
"templateId": "4",
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "abc123",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": false,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
passTemplates
Response
Returns [PassTemplate!]!
Example
Query
query PassTemplates {
passTemplates {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
}
Response
{
"data": {
"passTemplates": [
{
"id": "4",
"name": "abc123",
"downloadUrl": "xyz789",
"downloadUrlGooglePay": "abc123",
"variables": [PassTemplateVariable]
}
]
}
}
projects
Response
Returns [Project!]!
Example
Query
query Projects {
projects {
id
name
scanConfig
}
}
Response
{
"data": {
"projects": [
{
"id": "4",
"name": "xyz789",
"scanConfig": "xyz789"
}
]
}
}
Mutations
createEventTicketPass
Response
Returns a Pass!
Arguments
| Name | Description |
|---|---|
eventTicketId - ID!
|
ID of event ticket definition. Can be fetched using Query.eventTickets.id |
id - ID
|
|
input - PassInput!
|
|
eventTicketInput - EventTicketPassInput!
|
Example
Query
mutation CreateEventTicketPass(
$eventTicketId: ID!,
$id: ID,
$input: PassInput!,
$eventTicketInput: EventTicketPassInput!
) {
createEventTicketPass(
eventTicketId: $eventTicketId,
id: $id,
input: $input,
eventTicketInput: $eventTicketInput
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{
"eventTicketId": 4,
"id": "4",
"input": PassInput,
"eventTicketInput": EventTicketPassInput
}
Response
{
"data": {
"createEventTicketPass": {
"id": 4,
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "xyz789",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": true,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
createLoyaltyCardPass
Response
Returns a Pass!
Arguments
| Name | Description |
|---|---|
loyaltyCardId - ID!
|
ID of loyalty card definition. Can be fetched using Query.loyaltyCards.id |
id - ID
|
|
input - PassInput!
|
|
loyaltyCardInput - LoyaltyCardPassInput!
|
Example
Query
mutation CreateLoyaltyCardPass(
$loyaltyCardId: ID!,
$id: ID,
$input: PassInput!,
$loyaltyCardInput: LoyaltyCardPassInput!
) {
createLoyaltyCardPass(
loyaltyCardId: $loyaltyCardId,
id: $id,
input: $input,
loyaltyCardInput: $loyaltyCardInput
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{
"loyaltyCardId": 4,
"id": 4,
"input": PassInput,
"loyaltyCardInput": LoyaltyCardPassInput
}
Response
{
"data": {
"createLoyaltyCardPass": {
"id": 4,
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "xyz789",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": false,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
createPass
Response
Returns a Pass!
Arguments
| Name | Description |
|---|---|
projectId - ID!
|
|
id - ID
|
|
input - PassInput!
|
Example
Query
mutation CreatePass(
$projectId: ID!,
$id: ID,
$input: PassInput!
) {
createPass(
projectId: $projectId,
id: $id,
input: $input
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{"projectId": 4, "id": 4, "input": PassInput}
Response
{
"data": {
"createPass": {
"id": "4",
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "xyz789",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": true,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
createScanEvent
Response
Returns a ScanEvent!
Arguments
| Name | Description |
|---|---|
input - ScanEventInput!
|
Example
Query
mutation CreateScanEvent($input: ScanEventInput!) {
createScanEvent(input: $input) {
id
code
rewardPoints
voided
data
createdAt
pass {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
...PassTemplateVariableFragment
}
}
project {
id
name
scanConfig
}
}
}
}
Variables
{"input": ScanEventInput}
Response
{
"data": {
"createScanEvent": {
"id": "4",
"code": "xyz789",
"rewardPoints": 987,
"voided": true,
"data": AWSJSON,
"createdAt": "2020-01-01T15:00:00Z",
"pass": Pass
}
}
}
deletePassMessage
Example
Query
mutation DeletePassMessage(
$projectId: ID!,
$passId: ID!,
$id: ID!
) {
deletePassMessage(
projectId: $projectId,
passId: $passId,
id: $id
) {
id
body
header
destinations
notifications
order
dateFrom
dateTo
}
}
Variables
{"projectId": 4, "passId": "4", "id": 4}
Response
{
"data": {
"deletePassMessage": {
"id": 4,
"body": "abc123",
"header": "abc123",
"destinations": ["APPLE"],
"notifications": ["APPLE"],
"order": 123,
"dateFrom": "2020-01-01T15:00:00Z",
"dateTo": "2020-01-01T15:00:00Z"
}
}
}
deletePassTemplateMessage
Example
Query
mutation DeletePassTemplateMessage(
$templateId: ID!,
$id: ID!
) {
deletePassTemplateMessage(
templateId: $templateId,
id: $id
) {
id
body
header
destinations
notifications
order
dateFrom
dateTo
}
}
Variables
{
"templateId": "4",
"id": "4"
}
Response
{
"data": {
"deletePassTemplateMessage": {
"id": 4,
"body": "xyz789",
"header": "xyz789",
"destinations": ["APPLE"],
"notifications": ["APPLE"],
"order": 987,
"dateFrom": "2020-01-01T15:00:00Z",
"dateTo": "2020-01-01T15:00:00Z"
}
}
}
putPassMessage
Response
Returns a Message!
Arguments
| Name | Description |
|---|---|
projectId - ID!
|
|
passId - ID!
|
|
message - MessageInput!
|
Example
Query
mutation PutPassMessage(
$projectId: ID!,
$passId: ID!,
$message: MessageInput!
) {
putPassMessage(
projectId: $projectId,
passId: $passId,
message: $message
) {
id
body
header
destinations
notifications
order
dateFrom
dateTo
}
}
Variables
{"projectId": 4, "passId": 4, "message": MessageInput}
Response
{
"data": {
"putPassMessage": {
"id": "4",
"body": "xyz789",
"header": "abc123",
"destinations": ["APPLE"],
"notifications": ["APPLE"],
"order": 123,
"dateFrom": "2020-01-01T15:00:00Z",
"dateTo": "2020-01-01T15:00:00Z"
}
}
}
putPassTemplateMessage
Response
Returns a Message!
Arguments
| Name | Description |
|---|---|
templateId - ID!
|
|
message - MessageInput!
|
Example
Query
mutation PutPassTemplateMessage(
$templateId: ID!,
$message: MessageInput!
) {
putPassTemplateMessage(
templateId: $templateId,
message: $message
) {
id
body
header
destinations
notifications
order
dateFrom
dateTo
}
}
Variables
{"templateId": 4, "message": MessageInput}
Response
{
"data": {
"putPassTemplateMessage": {
"id": 4,
"body": "xyz789",
"header": "abc123",
"destinations": ["APPLE"],
"notifications": ["APPLE"],
"order": 123,
"dateFrom": "2020-01-01T15:00:00Z",
"dateTo": "2020-01-01T15:00:00Z"
}
}
}
registerDevice
Response
Returns a RegisterDeviceResult!
Arguments
| Name | Description |
|---|---|
input - DeviceInput!
|
Example
Query
mutation RegisterDevice($input: DeviceInput!) {
registerDevice(input: $input) {
workspaceName
token
}
}
Variables
{"input": DeviceInput}
Response
{
"data": {
"registerDevice": {
"workspaceName": "xyz789",
"token": "abc123"
}
}
}
updateEventTicketPass
Response
Returns a Pass!
Arguments
| Name | Description |
|---|---|
eventTicketId - ID!
|
ID of loyalty card definition. Can be fetched using Query.eventTickets.id |
id - ID!
|
|
input - PassInput!
|
|
eventTicketInput - EventTicketPassInput!
|
Example
Query
mutation UpdateEventTicketPass(
$eventTicketId: ID!,
$id: ID!,
$input: PassInput!,
$eventTicketInput: EventTicketPassInput!
) {
updateEventTicketPass(
eventTicketId: $eventTicketId,
id: $id,
input: $input,
eventTicketInput: $eventTicketInput
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{
"eventTicketId": 4,
"id": "4",
"input": PassInput,
"eventTicketInput": EventTicketPassInput
}
Response
{
"data": {
"updateEventTicketPass": {
"id": 4,
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "abc123",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": true,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
updateLoyaltyCardPass
Response
Returns a Pass!
Arguments
| Name | Description |
|---|---|
loyaltyCardId - ID!
|
ID of loyalty card definition. Can be fetched using Query.loyaltyCards.id |
id - ID!
|
|
input - PassInput!
|
|
loyaltyCardInput - LoyaltyCardPassInput!
|
Example
Query
mutation UpdateLoyaltyCardPass(
$loyaltyCardId: ID!,
$id: ID!,
$input: PassInput!,
$loyaltyCardInput: LoyaltyCardPassInput!
) {
updateLoyaltyCardPass(
loyaltyCardId: $loyaltyCardId,
id: $id,
input: $input,
loyaltyCardInput: $loyaltyCardInput
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{
"loyaltyCardId": 4,
"id": "4",
"input": PassInput,
"loyaltyCardInput": LoyaltyCardPassInput
}
Response
{
"data": {
"updateLoyaltyCardPass": {
"id": 4,
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "abc123",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": false,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
updatePass
Response
Returns a Pass
Arguments
| Name | Description |
|---|---|
projectId - ID!
|
|
id - ID!
|
|
input - PassInput!
|
Example
Query
mutation UpdatePass(
$projectId: ID!,
$id: ID!,
$input: PassInput!
) {
updatePass(
projectId: $projectId,
id: $id,
input: $input
) {
id
templateId
parameters
files {
background
footer
icon
logo
strip
thumbnail
}
type
expirationDate
voided
download {
url
expiration
}
downloadGooglePay {
url
expiration
}
share {
url
expiration
}
template {
id
name
downloadUrl
downloadUrlGooglePay
variables {
name
type
scope
}
}
project {
id
name
scanConfig
}
}
}
Variables
{"projectId": 4, "id": 4, "input": PassInput}
Response
{
"data": {
"updatePass": {
"id": 4,
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "abc123",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": true,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
}
}
Types
AWSDateTime
Description
An extended ISO 8601 date and time string in the format
Example
"2020-01-01T15:00:00Z"
AWSJSON
Example
AWSJSON
Boolean
Description
The Boolean scalar type represents true or false.
Example
true
DeviceInput
Fields
| Input Field | Description |
|---|---|
name - String
|
Example
{"name": "xyz789"}
EventTicket
EventTicketPassInput
Fields
| Input Field | Description |
|---|---|
points - Int!
|
Number of points to the event ticket pass, eg. number of entries to the event. |
Example
{"points": 987}
ID
Description
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
Example
4
Int
Description
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
987
LoyaltyCard
LoyaltyCardPassInput
Fields
| Input Field | Description |
|---|---|
points - Int!
|
Number of points to the loyalty card pass, eg. initial number of loyalty points. |
Example
{"points": 123}
Message
Fields
| Field Name | Description |
|---|---|
id - ID!
|
|
body - String!
|
|
header - String!
|
|
destinations - [Platform!]!
|
|
notifications - [Platform!]!
|
|
order - Int
|
|
dateFrom - AWSDateTime
|
|
dateTo - AWSDateTime
|
Example
{
"id": "4",
"body": "abc123",
"header": "abc123",
"destinations": ["APPLE"],
"notifications": ["APPLE"],
"order": 987,
"dateFrom": "2020-01-01T15:00:00Z",
"dateTo": "2020-01-01T15:00:00Z"
}
MessageInput
Fields
| Input Field | Description |
|---|---|
id - ID!
|
|
body - String!
|
|
header - String!
|
|
destinations - [Platform!]!
|
|
notifications - [Platform!]!
|
|
order - Int
|
|
dateFrom - AWSDateTime
|
|
dateTo - AWSDateTime
|
Example
{
"id": 4,
"body": "xyz789",
"header": "xyz789",
"destinations": ["APPLE"],
"notifications": ["APPLE"],
"order": 123,
"dateFrom": "2020-01-01T15:00:00Z",
"dateTo": "2020-01-01T15:00:00Z"
}
Pass
Fields
| Field Name | Description |
|---|---|
id - ID!
|
|
templateId - ID!
|
|
parameters - String
|
JSON formatted string |
files - PassFiles!
|
|
type - String
|
|
expirationDate - AWSDateTime
|
Date and time when the pass expires. |
voided - Boolean
|
Indicates that the pass is void—for example, a one time use coupon that has been redeemed. The default value is false. |
download - PassDownload!
|
|
downloadGooglePay - PassDownload
|
|
share - PassShare!
|
|
Arguments
|
|
template - PassTemplate
|
|
project - Project
|
|
Example
{
"id": "4",
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFiles,
"type": "abc123",
"expirationDate": "2020-01-01T15:00:00Z",
"voided": true,
"download": PassDownload,
"downloadGooglePay": PassDownload,
"share": PassShare,
"template": PassTemplate,
"project": Project
}
PassDownload
Fields
| Field Name | Description |
|---|---|
url - String!
|
|
expiration - AWSDateTime
|
Example
{
"url": "xyz789",
"expiration": "2020-01-01T15:00:00Z"
}
PassFiles
PassFilesInput
PassInput
Fields
| Input Field | Description |
|---|---|
templateId - ID!
|
ID of pass template. Can be fetched using Query.passTemplates.id |
parameters - String
|
JSON formatted string |
files - PassFilesInput
|
|
expirationDate - AWSDateTime
|
Date and time when the pass expires. |
voided - Boolean
|
Indicates that the pass is void—for example, a one time use coupon that has been redeemed. The default value is false. |
Example
{
"templateId": 4,
"parameters": "{\"foo\":\"blah\"}",
"files": PassFilesInput,
"expirationDate": "2020-01-01T15:00:00Z",
"voided": false
}
PassTemplate
Fields
| Field Name | Description |
|---|---|
id - ID!
|
|
name - String
|
|
downloadUrl - String!
|
|
downloadUrlGooglePay - String!
|
|
variables - [PassTemplateVariable!]!
|
Example
{
"id": "4",
"name": "abc123",
"downloadUrl": "abc123",
"downloadUrlGooglePay": "xyz789",
"variables": [PassTemplateVariable]
}
PassTemplateVariable
Fields
| Field Name | Description |
|---|---|
name - String!
|
|
type - PassTemplateVariableType!
|
|
scope - PassTemplateVariableScope!
|
Example
{
"name": "xyz789",
"type": "STRING",
"scope": "PUBLIC"
}
PassTemplateVariableScope
Values
| Enum Value | Description |
|---|---|
|
|
|
|
|
|
|
|
Example
"PUBLIC"
PassTemplateVariableType
Values
| Enum Value | Description |
|---|---|
|
|
Example
"STRING"
Platform
Values
| Enum Value | Description |
|---|---|
|
|
|
|
|
Example
"APPLE"
Project
RegisterDeviceResult
ScanEvent
ScanEventInput
String
Description
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
"xyz789"