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 PUT /todos body id (200)

Issue a PUT request to /todos and include the id of an existing todo in the request body.

This API allows the identifier for a PUT update to come from the payload, so /todos can update a specific todo when the body contains an existing id.

Basic Instructions

  • Send PUT /todos
  • Add an X-CHALLENGER header to track challenge completion
  • Set Content-Type to application/json
  • Include an id for an existing todo in the JSON payload
  • Include a valid title because this API treats PUT as a replacement update
  • Verify the response status is 200

Example body:

{
  "id": 3,
  "title": "updated using body id",
  "doneStatus": true,
  "description": "updated by PUT /todos"
}

Try it now

If you don't know what todos are available then you can check by GET /todos. See the solution.

GET /todos to see what todos are available now

If you have already deleted all todos, create one using POST /todos. See the solution.

POST /todos to create a todo item for this challenge
PUT /todos with an existing id in the payload
Experiment with this endpoint