The POST /stream
endpoint allows you to register actions on your events/tickets alongside all of their relevant metadata within GET Protocol and propagate this data to the blockchain.
The accepted actions are:
newEvent
updateEvent
soldTicket
updateTicket
resoldTicket
scannedTicket
checkedInTicket
claimedTicket
invalidatedTicket
An event must first be registered before any ticket action be accepted within that event.
Per action, the following fields are accepted:
- Required Fields: all specified must be sent
- Exclusive Fields: 1 required but no more than 1 accepted
- Optional Fields: all can be omitted, defaults will be used (see
Data Field Types
table for defaults)
action | required fields | exclusive fields | optional fields |
---|---|---|---|
newEvent | eventId currency | - | eventName shopUrl coverImageUrl coverMediaUrl defaultNftImageUrl defaultNftMediaUrl latitude longitude startTime endTime callbackUrl |
updateEvent | eventId | - | eventName currency shopUrl coverImageUrl coverMediaUrl defaultNftImageUrl defaultNftMediaUrl latitude longitude startTime endTime callbackUrl |
soldTicket | eventId ticketId price | - | imageUrl mediaUrl orderTime to |
updateTicket | - | ticketId nftId | imageUrl mediaUrl |
resoldTicket | price | ticketId nftId | orderTime to |
scannedTicket | - | ticketId nftId | orderTime |
checkedInTicket | - | ticketId nftId | orderTime |
claimedTicket | to | ticketId nftId | orderTime |
invalidatedTicket | - | ticketId nftId | orderTime |
Data field types:
data field | type | validation | default value | on blockchain? |
---|---|---|---|---|
eventId | string | up to 255 chars | - | no |
eventName | string | up to 255 chars | blank string | yes |
currency | string | ISO 4217, exactly 3 chars - see supported currencies | - | yes |
shopUrl | string | http/https url, up to 255 chars | blank string | yes |
coverImageUrl | string | http/https url, up to 255 chars | blank string | yes |
coverMediaUrl | string | http/https url, up to 255 chars | blank string | no |
defaultNftImageUrl | string | http/https url, up to 255 chars | blank string | no |
defaultNftMediaUrl | string | http/https url, up to 255 chars | blank string | no |
latitude | float | latitude | 0.0 | yes |
longitude | float | longitude | 0.0 | yes |
startTime | integer | unsigned integer 64 | 0 | yes |
endTime | integer | unsigned integer 64 | 0 | yes |
callbackUrl | string | http/https url, up to 255 chars | - | no |
ticketId | string | up to 255 chars | - | yes, sha256(ticketId ) |
nftId | string | valid GETProtocol NFT Id (e.g. POLYGON-123-123) | - | no |
imageUrl | string | http/https url, up to 255 chars | blank string | no |
price | string | valid price string represented | - | yes |
orderTime | integer | unsigned integer 64 | now unix timestamp | yes |
to | string | blockchain wallet address | - | yes |
Null vs Empty
On event and tickets updates with
eventUpdate
orticketUpdate
actions respectively, you can send the default value from the table above on non required fields to have them cleared.You can also send the
json null
value i.e."imageUrl": null
or completely omit fields that are not intended to be updated.
Next you can find an example payload for an event with a single ticket that went through all the possible states until being claimed by/to a ticket buyer account:
[
{
"action": "newEvent",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"eventName": "porro ut autem",
"currency": "EUR",
"shopUrl": "http://roberto.net",
"coverImageUrl": "https://placeimg.com/640/480/nature",
"coverMediaUrl": "",
"defaultNftImageUrl": "https://images.get-blockchain.io/get-protocol-default-nftimage.png",
"defaultNftMediaUrl": "https://www.youtube.com/watch?v=cjXSeElvbss",
"startTime": 1652285087,
"endTime": 1652285087,
"latitude": -24.2066,
"longitude": -159.3224,
"callbackUrl": "http://callback.url/callback"
}
},
{
"action": "soldTicket",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"price": "136.91",
"imageUrl": "http://placeimg.com/640/480",
"mediaUrl": "https://www.youtube.com/watch?v=cjXSeElvbss",
}
},
{
"action": "updateTicket",
"data": {
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"imageUrl": "http://updated.image.com/",
"mediaUrl": "http://updated.video.com/"
}
},
{
"action": "resoldTicket",
"data": {
"nftId": "POLYGON-123-123",
"price": "466.25"
}
},
{
"action": "scannedTicket",
"data": {
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
}
},
{
"action": "updateEvent",
"data": {
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"imageUrl": "https://placeimg.com/640/480/tech",
"defaultNftImageUrl": "https://images.get-blockchain.io/get-protocol-default-nftimage.png"
}
},
{
"action": "checkedInTicket",
"data": {
"nftId": "POLYGON-123-123",
}
},
{
"action": "claimedTicket",
"data": {
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"to": "0x72e5c6e078001644b15c3b8d56a019c8f551adc4"
}
}
]
Limits & Ordering
Each request can include up to 5000 actions. Actions are processed and their result returned in the order they are sent in the request.
A request with the previous payload should yield a response similar to:
{
"status": "success",
"data": [
{
"status": "success",
"action": "newEvent",
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "a58b6a0c-2e59-4bb0-8b19-9a3f77c934b3"
},
{
"status": "success",
"action": "soldTicket",
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"actionPromise": "22709bf7-59a8-4751-82f1-06184b9dcf22"
},
{
"status": "success",
"action": "updateTicket",
"ticketId": "10cd5d96-ecc1-43ae-b1bc-b248da171c92",
"actionPromise": "3280fc95-d8fa-4b77-a375-9216f27f1df3"
},
{
"status": "success",
"action": "resoldTicket",
"nftId": "POLYGON-123-123",
"actionPromise": "d31dc1c8-641c-4c3b-a2d1-78963f9c8590"
},
{
"status": "success",
"action": "scannedTicket",
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "c9d73b07-8a85-4198-af4d-f6e3fd7a4b8f"
},
{
"status": "success",
"action": "updateEvent",
"eventId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "a487b584-03a9-45fc-995e-badb42250c25"
},
{
"status": "success",
"action": "checkedInTicket",
"nftId": "POLYGON-123-123",
"actionPromise": "c545e395-e13e-4969-9b50-52c14ed782f6"
},
{
"status": "success",
"action": "claimedTicket",
"ticketId": "1b15b541-7d60-4ae8-b41f-aca6b981a6e7",
"actionPromise": "c2e8df23-6411-46e0-8ec2-61cb0a29f6af"
}
]
}
Save the promise
Each successful action request will return you an
actionPromise
. Save it on your data model such that you can use it later to query for each action request status.