How to complete the challenge GET /api/challenges (200).
How to use a GET request with an x-challenger header to get the progress status of all the API Challenges.
GET /api/challenges (200)
Issue a
GETrequest on the/api/challengesend point
- This will show you the status of all the challenges in your REST Client, if you include an
X-CHALLENGERguid header in your request.
Basic Instructions
- Issue a GET request to end point "/api/challenges"
https://apichallenges.com/api/challenges
- The request should have an
X-CHALLENGERheader - The response body shows the status of all the challenges.
Try it now
GET /api/challenges to list the available challenges
Example Request
> GET /api/challenges HTTP/1.1
> Host: apichallenges.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Accept: */*
Example Response
< HTTP/1.1 200 OK
< Connection: close
< Date: Thu, 27 Aug 2020 13:38:45 GMT
< Content-Type: application/json
< Location: /api/challenger/x-challenger-guid
< X-Challenger: x-challenger-guid
< Server: Jetty(9.4.z-SNAPSHOT)
< Via: 1.1 vegur
Example Response Payload
{
"challenges": [
{
"name": "POST /api/challenger (201)",
"description": "Issue a POST request on the `/api/challenger` end point,
with no body, to create a new challenger session.
Use the generated X-CHALLENGER header in
future requests to track challenge completion.",
"status": true
},
{
"name": "GET /api/challenges (200)",
"description": "Issue a GET request on the `/api/challenges` end point",
"status": true
}
]
}
Overview Video
Lessons Learned
GET /api/challengesexposes progress state rather than todo application data.- This endpoint is a dashboard API: the response tells you what the server thinks you have completed.
- Including
X-CHALLENGERchanges the result from generic challenge info to your tracked session.
Suggested Experiments
- Call
GET /api/challenges, complete one challenge, then call it again and compare the completion flags. - Request
/api/challengeswith and withoutX-CHALLENGERto see how session tracking changes the response.