You can support this site from as little as $1 a month on Patreon.

The support pays for site hosting and the expansion of this content.

In addition, Patreon Supporters gain access to exclusive online video training courses and ebooks.

Join Now

How to complete the challenge GET /todos (200) ? filter id single result

How to issue a GET request on a top level entity endpoint and filter by one todo id while there are multiple todos in the database.

GET /todos (200) ? filter id single result

Issue a GET request on the /todos end point with an id filter that returns one todo while multiple todos exist in the database.

  • id=3 means return the todo where the id is exactly 3
  • there must be more than one todo in your current session
  • the response should contain exactly one todo
  • the returned todo should have the same id that you filtered on

Basic Instructions

  • Issue a GET request to end point "/todos"
    • https://apichallenges.eviltester.com/todos
  • The request should have an X-CHALLENGER header to track challenge completion
  • Choose an id from the current todo list
  • Add the id as an exact filter:
    • https://apichallenges.eviltester.com/todos?id=3
  • The response status code should be 200 because the request is accepted
  • Check that the response contains one todo with the requested id

Try it now

If you need to check which todo ids are available, use GET /todos. See the solution.

GET /todos to see the available todo ids

If you do not have more than one todo, create another one using POST /todos. See the solution.

POST /todos to create another todo item

The sample below uses id=3; edit the id if your current data uses a different todo id.

GET /todos?id=3 to return one matching todo

Example Request

> GET /todos?id=3 HTTP/1.1
> Host: apichallenges.eviltester.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Accept: application/json

Example Response

< HTTP/1.1 200 OK
< Connection: close
< Content-Type: application/json
< X-Challenger: x-challenger-guid

Returned body:

{
  "todos": [
    { "id": 3, "title": "single matching todo", "doneStatus": false, "description": "" }
  ]
}