This REST API is a mock to run challenges at events. Basically participants can submit an answer to a challenge, and an algorithm will pick a winnder.
The data are mocked in this example.
Here is a postman collection and HTML documentation of the REST API.
git clone
cd
npm install
DEBUG=api* node server.js
If runnning locally, replace $server with http://localhost:8080 if running the heroku live demo, replace with https://pixelscamp-challenge.herokuapp.com
GET {{server}}/api/challenges
[
{
"id": "pixelscamp2017-day1",
"event_id": "pixelscamp2017",
"begin": "2017-09-28T10:00:00.000Z",
"end": "2017-09-28T18:00:00.000Z",
"status": "not started"
}
]
POST {{server}}/api/challenges/pixelscamp2017-day1/answers
{
"weight" : 12345
}
{
"createdAt": "2017-09-20T16:34:24.204Z",
"data": {
"weight": 12345
},
"submitter": {
"email": "[email protected]",
"devnetId": "123456789",
"firstName": "Stève",
"lastName": "Sfartz"
}
}
GET {{server}}/api/challenges/pixelscamp2017-day1/answers
[
{
"createdAt": "2017-09-20T16:34:24.204Z",
"data": {
"weight": 12345
},
"submitter": {
"email": "[email protected]",
"devnetId": "123456789",
"firstName": "Stève",
"lastName": "Sfartz"
}
}
]
GET {{server}}/api/challenges/pixelscamp2017-day1/winners?weight=12345
[
{
"createdAt": "2017-09-20T16:34:24.204Z",
"data": {
"weight": 12345
},
"submitter": {
"email": "[email protected]",
"devnetId": "123456789",
"firstName": "Stève",
"lastName": "Sfartz"
},
"score": 1.4224165
}
]