Skip to content
On this page

Ticket API

EndpointMethodDescription
/api/v0/resource/ticket/{ticketId}webRequestGet ticket PDF file
/api/v0/rpc/ticket.getPurchasableTicketsjsonRpcGet purchasable tickets
ticket:getPurchasableTicketswebsocketGet purchasable tickets
ticket:purchaseTicketwebsocketPurchase ticket
ticket:deleteTicketwebsocketDelete ticket
ticket:getPurchasedTicketwebsocketGet purchased ticket
ticket:getPurchasedTicketswebsocketGet purchased tickets
ticket:onTicketPurchasedwebsocketEventOn ticket purchased event

Get ticket PDF file

HTTP Method: GET

Path: /api/v0/resource/ticket/

Description: Endpoint returns PDF file for the ticket. User must be authorized in order to fetch his ticket.

Request:

{ empty }

Response:

PDF file

Get purchasable tickets

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/rpc/ticket.getPurchasableTickets

Description: API returns all tickets that could be purchased for an event.

Headers:

X-Session-Id: sessionToken

X-Network-Id: networkId

Request:

{ empty }

Response:

{
    "data": {
        "tickets": [{
            "productId": string  // unique product identifier
            "eventName": string  // name of related event
            "eventStartDate": timestamp  // start date of related event
            "eventEndDate": timestamp  // end date of related event
            "ticketType": string  // single/days:1of3/days:2of3
            "ticketName": string  // name of ticket that is shown to client
            "ticketDescription": string  // description of ticket that is shown to client
            "price": float  // price in USD
            "thumbnailId": string  // resource id of thumbnail
            "discount": string  // marketing discount, no actual effects on price
            "grants": [{  // rewards granted by ticket
                "grantType": string  // userRole
                "grantTarget": string  // roleId:roleTarget
            }]
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Get purchasable tickets

Method: websocket

Endpoint: ticket:getPurchasableTickets

Description: API returns all tickets that could be purchased for an event.

Request:

{ empty }

Response:

{
    "data": {
        "tickets": [{
            "productId": string  // unique product identifier
            "eventName": string  // name of related event
            "eventStartDate": timestamp  // start date of related event
            "eventEndDate": timestamp  // end date of related event
            "ticketType": string  // single/days:1of3/days:2of3
            "ticketName": string  // name of ticket that is shown to client
            "ticketDescription": string  // description of ticket that is shown to client
            "price": float  // price in USD
            "thumbnailId": string  // resource id of thumbnail
            "discount": string  // marketing discount, no actual effects on price
            "grants": [{  // rewards granted by ticket
                "grantType": string  // userRole
                "grantTarget": string  // roleId:roleTarget
            }]
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Purchase ticket

Method: websocket

Endpoint: ticket:purchaseTicket

Description: TEST API for testing ticket purchase without paying. Accessible only for network admins.

Request:

{
    "data": {
        "productId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "ticket": {
            "ticketId": string
            "userId": string
            "purchaseDate": timestamp
            "productId": string  // unique product identifier
            "eventName": string  // name of related event
            "eventStartDate": timestamp  // start date of related event
            "eventEndDate": timestamp  // end date of related event
            "ticketType": string  // single/days:1of3/days:2of3
            "ticketName": string  // name of ticket that is shown to client
            "ticketDescription": string  // description of ticket that is shown to client
            "price": float  // price in USD
            "thumbnailId": string  // resource id of thumbnail
            "discount": string  // marketing discount, no actual effects on price
            "grants": [{  // rewards granted by ticket
                "grantType": string  // userRole
                "grantTarget": string  // roleId:roleTarget
            }]
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Delete ticket

Method: websocket

Endpoint: ticket:deleteTicket

Description: TEST API for deleting test ticket. Accessible only for network admins.

Request:

{
    "data": {
        "ticketId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}

Get purchased ticket

Method: websocket

Endpoint: ticket:getPurchasedTicket

Description: API returns a ticket that was purchased by a user.

Request:

{
    "data": {
        "ticketId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "ticket": {
            "ticketId": string
            "userId": string
            "purchaseDate": timestamp
            "productId": string  // unique product identifier
            "eventName": string  // name of related event
            "eventStartDate": timestamp  // start date of related event
            "eventEndDate": timestamp  // end date of related event
            "ticketType": string  // single/days:1of3/days:2of3
            "ticketName": string  // name of ticket that is shown to client
            "ticketDescription": string  // description of ticket that is shown to client
            "price": float  // price in USD
            "thumbnailId": string  // resource id of thumbnail
            "discount": string  // marketing discount, no actual effects on price
            "grants": [{  // rewards granted by ticket
                "grantType": string  // userRole
                "grantTarget": string  // roleId:roleTarget
            }]
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Get purchased tickets

Method: websocket

Endpoint: ticket:getPurchasedTickets

Description: API returns a list of tickets that were purchased by a user.

Request:

{ empty }

Response:

{
    "data": {
        "tickets": [{
            "ticketId": string
            "userId": string
            "purchaseDate": timestamp
            "productId": string  // unique product identifier
            "eventName": string  // name of related event
            "eventStartDate": timestamp  // start date of related event
            "eventEndDate": timestamp  // end date of related event
            "ticketType": string  // single/days:1of3/days:2of3
            "ticketName": string  // name of ticket that is shown to client
            "ticketDescription": string  // description of ticket that is shown to client
            "price": float  // price in USD
            "thumbnailId": string  // resource id of thumbnail
            "discount": string  // marketing discount, no actual effects on price
            "grants": [{  // rewards granted by ticket
                "grantType": string  // userRole
                "grantTarget": string  // roleId:roleTarget
            }]
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

On ticket purchased event

Event: ticket:onTicketPurchased

Description: Event notifies user that a ticket was purchased by him.

Data:

{
    "data": {
        "ticket": {
            "ticketId": string
            "userId": string
            "purchaseDate": timestamp
            "productId": string  // unique product identifier
            "eventName": string  // name of related event
            "eventStartDate": timestamp  // start date of related event
            "eventEndDate": timestamp  // end date of related event
            "ticketType": string  // single/days:1of3/days:2of3
            "ticketName": string  // name of ticket that is shown to client
            "ticketDescription": string  // description of ticket that is shown to client
            "price": float  // price in USD
            "thumbnailId": string  // resource id of thumbnail
            "discount": string  // marketing discount, no actual effects on price
            "grants": [{  // rewards granted by ticket
                "grantType": string  // userRole
                "grantTarget": string  // roleId:roleTarget
            }]
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}