New competition APIs is used to easily share information and for public interaction, as they are public competition APIs.
Overview
Competition APIs are the interfaces, which has a set of functions that allow clients to access specific competition features or data of TractionNext.
It is an API over the web, which can be accessed using HTTPs protocol.
How to use it?
To test the Competition API, Create a competition. Select a competition type and competition channel as ‘API Competition’.
Fill the required inputs in ‘General’ and ‘Manage’ tabs and go to ‘Settings’ tab.
Select the entrantId. Add any other parameter such as Entry code, Gender etc. Mark then ‘Required’ if needed. Map the parameters as shown in below screen…
Now you have the details for entry request, validate entry request, JSON data and Authorization token (these values need to supply while testing APIs) as shown in below screen…
Now, navigate to
For AU: https://compapi.tractionnext.com/help/index
For UK: https://compapi.tractionnext.co.uk/help/index
There are public competition APIs listed.
1. /v1/Competition/Enter
Expand /v1/Competition/Enter
Update the authorization token, request body and click try it out!
Authorization token is added instead of XXX, i.e. also called API key.
JSON data can be used in entry as shown below
This response will appear if the competition is not live.
OR
Now make the competition live and run the api request again with the following payload
{
"EntryData": {
"EntrantId":"john_doe@tractiondigital.com"
}
}
The entry is denied as the submit data does not contain all the required field
Now try with the following data:
{
"EntryData": {
"EntrantId":"john_doe@tractiondigital.com",
"EntryCode":"TEST2"
}
}
2. /v1/Competition/ValidateEntry
Expand /v1/Competition/ValidateEntry
Update the authorization token, request body and click try it out!
Try with the following data:
{
"EntryData": {
"EntrantId":"john_doe@tractiondigital.com",
"EntryCode":"TEST2"
}
}
Above result validates the entry.
3. /v1/Competition/TestEntryCode
Expand /v1/Competition/TestEntryCode
Update the authorization token, Entry code and click try it out!
Try with the following data:
Below is the response for Entry code test, It says entry code is valid.
4. /v1/Competition/TestEntryLimit
Expand /v1/Competition/TestEntryCode
Update the authorization token, Entrant Id (e.g. Email) and click try it out!
Try with the following data:
Below is the response for Entry limit test, It says entry is still possible for this entrant.
5. /v1/Competition/Redeem
Expand /v1/Competition/Redeem
To test the Redeem API, you should create a competition with Prize redemption then only you can get the Redeem JSON data to supply in ‘Redemption Request’ body.
When you create a Prize redemption for API competition as shown in below screen…
Select the EntrantId. Add any other parameter such as Redemption code etc. Map the parameters as shown in below screen…
Now you have the details for Redemption request, JSON data and Header/Authorization token (these values need to supply while testing APIs) as shown in below screen…
Now Run this API first to enter into the competition,
Make the entrant win and then only you can Redeem the prize.
If your redemption is successful, you will get the following response…
If the redemption code is invalid, it displays the following response.
Comments
0 comments
Please sign in to leave a comment.