How to complete the challenge PUT /api/todos/{id} no body id (200)

Issue a PUT request to /api/todos/{id} and do not include an id field in the request body.

This is a common PUT design: the URL identifies the resource and the body supplies the replacement state.

Basic Instructions

  • Send PUT /api/todos/{id} where {id} is an existing todo id
  • Add an X-CHALLENGER header to track challenge completion
  • Set Content-Type to application/json
  • Do not include an id field in the JSON payload
  • Include a valid title
  • Verify the response status is 200

Example body:

{
  "title": "updated using URL id",
  "doneStatus": false,
  "description": "the id is only in the URL"
}

Try it now

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

GET /api/todos to see what todos are available now

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

POST /api/todos to create a todo item for this challenge
PUT /api/todos/{id} without an id in the payload

Lessons Learned

  • PUT /api/todos/{id} can use the path parameter as the update target when the body omits id.
  • Omitting body id avoids one class of mismatch while still requiring a valid representation.
  • The URL is part of the contract, not just routing decoration.

Suggested Experiments

  • Add a matching body id and compare the response with the no-body-id request.
  • Change only the path id while keeping the body the same to see which resource is updated.
Experiment with this endpoint