Stagecast Prizes API

API for managing, and delivering prizes for an event

Prize management

post
Create a prize in an event

https://stagecast.se/api/events/:eventId/prizes/
Create an unclaimed prize in an event (can be done by event owner and/or crew members)
Request
Response
Request
Path Parameters
eventId
required
string
The event identifier
Headers
X-Token
required
string
The authentication token as retrieved when logging in
Body Parameters
claimUrl
required
string
The URL where a user would be able to claim a prize. The URL can include a template marker $(PRIZE_TOKEN) that will be substituted before the user is redirected to the claim page. This prize token can then be used to verify that the user has the right for the prize from the sponsors page (if needed) and to check that the prize has not yet been claimed (if needed). See more about the prize token below.
description
required
string
A description of the prize - a slightly longer version of the title
title
required
string
The title of the prize
Response
201: Created
The response is the created prize object as it is stored in the backend, including its identifier and "claimed" status.
{
"id": "def321",
"title": "The prize",
"description": "The prize you have always dreamt of",
"claimUrl": "https://prize.sponsor.com/get_prize?prizeToken=$(PRIZE_TOKEN)&anythingGoes=...",
"associations": null,
}

get
List prizes for an event

https://stagecast.se/api/events/:eventId/prizes/
Get a list of prizes associated to the event (can be done by owner and/or crew members)
Request
Response
Request
Path Parameters
eventId
required
string
The event identifier
Headers
X-Token
required
string
The authentication token as retrieved when logging in
Query Parameters
limit
optional
integer
The maximum number of results to return (default is 10)
offset
optional
integer
The offset used if pagination is used (default is 0)
Response
200: OK
Returns a list of prize objects and their claimed statuses
[{
"id": "def321",
"title": "The prize",
"description": "The prize for the winner",
"claimUrl": "https://prize.sponsor.com/get_prize?prizeToken=$(PRIZE_TOKEN)&something=1",
"associations": [{"momentClass":"abc-123","instances":5,"claimed":1}]
}, {
"id": "abcd",
"title": "The second prize",
"description": "The second best prize",
"claimUrl": "https://prize.sponsor.com/get_prize?prizeToken=$(PRIZE_TOKEN)&something=other",
"associations": [{"momentClass":"def-123","instances":0,"claimed":123434}]
}]

delete
Delete a prize associated with an event

https://stagecast.se/api/events/:eventId/prizes/:prizeId
Delete the prize from the event
Request
Response
Request
Path Parameters
prizeId
required
string
The prize identifier (as retrieved when creating it, or through listing the prizes)
eventId
required
string
The event identifier of the event
Response
200: OK

put
Associate a prize with a moment class

https://stagecast.se/api/events/:eventId/prizes/:prizeId/association
Request
Response
Request
Path Parameters
prizeId
required
string
The prize identifier
eventId
required
string
The event identifier
Body Parameters
instances
optional
integer
The number of instances available in the moment. If you want infinite number of prizes available you either set 'instances' to 0 or you skip assigning it completely.
momentClass
required
string
The moment class ID
Response
200: OK
{
"id": "def321",
"title": "The prize",
"description": "The prize for the winner",
"claimUrl": "https://prize.sponsor.com/get_prize?prizeToken=$(PRIZE_TOKEN)&something=1",
"association": {"momentClass":"abc-123","instances":5,"claimed":1}
}

Sample code

Javascript
Javascript
const association = {
momentClass: 'abc-123-adasd-asd-das-d-a',
instances: 5, // avoid assigning this or put it to 0 to get infinite instances
}
fetch('https://stagecast.se/api/events/abc-123/prizes/def-456/association', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'X-Token': 'asdasdasd...',
},
body: JSON.stringify(association),
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
})
.catch(error => {
console.error('Error:', error);
});

post
Complete the prize claim

https://stagecast.se/api/prizes/:prizeId
This is used by an external backend to signal that a prize (that is in "gathering" state) has now been fully claimed by the user (the user has filled in all forms and submitted the information to claim the prize). This will put the prize status as "claimed".
Request
Response
Request
Path Parameters
prizeId
required
string
The prize identifier (as extracted from the prize token that was handed over by the user when claiming the prize)
Body Parameters
prizeToken
required
string
The prize token that was handed over by the user when claiming the prize
Response
200: OK

Mobile prize API:s

get
Get a prize (via CDN)

https://d5q8k8cx63nj4.cloudfront.net/api/prizes/:prizeId
To anonymously get a prize object
Request
Response
Request
Path Parameters
prizeId
required
string
The prize identifier
Response
200: OK
{...the prize object}

get
Claim a prize

https://stagecast.se/api/prizes/:prizeId/claim/:reference
Get the URL to the external claim page. This will return a claim url where the prize token has been filled into the url template (if used in the url template). If the client supports redirection it also be redirected directly to the page in question as the response is returned with a 301 status and a location header. The prize will change its status to "gathering" when doing this request. A later callback by the external vendor (when the user has submitted its claim information) will put the prize status into "claimed". A prize will have four states: "created", "handed out", "gathering" and "claimed". It is only possible to get the claim url for a prize that is "handed out". A prize that is in "gathering" could be moved back to "unclaimed" if it does not become "claimed" within a certain time.
Request
Response
Request
Path Parameters
reference
required
string
This is a reference to the competition where this prize is being claimed (this is the moment identifier of the moment where the prize is being claimed)
prizeId
required
string
The prize identifier
Response
301: Moved Permanently
A client that supports redirection will be immediately redirected to the claim page. The prizeToken, if used in the url template, will be filled in by the backend.
HTTP/1.1 301 Moved Permanent
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
Content-Length: 88
Location: https://prize.sponsor.com/get_prize?prizeToken=fgh456&anyOtherParameter=something...
Content-Type: application/json
Connection: Closed
{
"claimUrl": "https://prize.sponsor.com/get_prize?prizeToken=fgh456&anyOtherParameter=something..."
}