Skip to main content

Apr 12, 2021 - 2 minute read - API Testing API Challenges Evil Tester

How To - DELETE todos/id 200

This post and video shows how to complete the challenge DELETE /todos/id (200) to successfully delete a todo item in the application.

What are the API Challenges?

Our API Challenges Application has a fully functional cloud hosted API, and a set of challenges to work through.

DELETE /todos/id (200)

Issue a DELETE request to successfully delete a todo

  • DELETE request will delete a todo if the provided id exists /todos/id end point
    • e.g. DELETE /todos/3 to delete the todo with id==3
  • 200 is an success code, in this case it means the todo was deleted
  • The body of the message is empty
  • add the X-CHALLENGER header

Basic Instructions

  • Issue a DELETE request to end point “/todos/id”
    • where id is replaced with the id of an existing todo
      • if you don’t know any then a GET /todos would show a list of todos, or you could POST /todos to create one.
    • if running locally that endpoint would be
      • http://localhost:4567/todos/id
    • if running in the cloud that endpoint would be
      • https://apichallenges.herokuapp.com/todos/id
  • The request should have an X-CHALLENGER header to track challenge completion
  • The response status code should be 200 when all the details are valid and the todo exists.
  • To double check that the todo item was deleted, then you could issue a GET request on the todo directly and receive a 404 or issue a GET request on /todos and check it is not in the list of todos.

Insomnia Details

> DELETE /todos/62 HTTP/1.1
> Host: apichallenges.herokuapp.com
> User-Agent: insomnia/2020.3.3
> X-CHALLENGER: x-challenger-guid
> Accept: */*
< HTTP/1.1 200 OK
< Connection: close
< Date: Thu, 27 Aug 2020 14:25:53 GMT
< Content-Type: application/json
< X-Challenger: x-challenger-guid
< Server: Jetty(9.4.z-SNAPSHOT)
< Via: 1.1 vegur

Overview Video

Watch on YouTube

Patreon ad free version

Learn More and Start Testing


You will need a Github account to comment. Or you can contact me with your comment.

I reserve the right to delete spam comments e.g. if your comment adds no value and its purpose is simply to create a backlink to another site offering training, or courses, etc.