This codebase contains everything you need to complete coding challenges of the Code100 competition in dotnet/C#.
The code example of communicating with the API is already present in the Program.cs file.
If you need additional information regarding the API you may find it in the rest of this document.
Open the terminal and run:
dotnet runhttps://challenger.code100.dev
https://challenger.code100.dev/doc/
In order to request the coding puzzle or submit the solution, you first need to retrieve the JSON Web Token by logging into the API:
POST /login
{
"email": <email here>,
"password": <password here>
}
{
...
"token": <JWT token>
...
}
The token given in this response needs to be supplied for the Request Puzzle and Submit Solution requests.
GET /getpuzzle
Authorization: Bearer <JWT token>
{
"name": <name of the puzzle>,
"description": <description of the puzzle>
"input": <coding challenge>
}
(coding challenge depends from round to round)
POST /postanswer
Authorization: Bearer <JWT token>
{
"answer": <your solution to the posted puzzle>
}
There is a 15 seconds delay for you to receive the answer for this request.
{
"message": <information if solution was correct or not>,
}