Skip to main content
blog title image

2 minute read - API Testing API Challenges

How To - GET todos id 200

Sep 17, 2020

This post and video shows how to complete the challenge GET /todos/id 200 using Insomnia.

What are the API Challenges?

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

GET /todos/id (200)

Issue a GET request on the /todos/{id} end point to return a specific todo

  • This will show you a todo in the API response
  • 200 status code means OK
  • The response is the basic JSON format you use in a POST request to create a todo
  • The {id} means, replace this with the id of an existing todo item

Basic Instructions

  • Issue a GET request to end point “/todos/{id}”
    • if running locally that would be
      • http://localhost:4567/todos/{id}
    • if running in the cloud that would be
      • https://apichallenges.herokuapp.com/todos/{id}
  • The request should have an X-CHALLENGER header
  • The response status code should be 200

Insomnia Details

> GET /todos/79 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: Tue, 01 Sep 2020 13:35:41 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< X-Challenger: x-challenger-guid
< Server: Jetty(9.4.z-SNAPSHOT)
< Via: 1.1 vegur

Example Response

{
  "todos": [
    {
      "id": 79,
      "title": "tidy meeting room",
      "doneStatus": false,
      "description": ""
    }
  ]
}

Overview Video

Patreon ad free version

Learn More and Start Testing