How to complete the challenge GET /todos (400) ?_limit too high

How to issue a GET request on a top level entity endpoint with a pagination limit above the allowed maximum.

GET /todos (400) ?_limit too high

Issue a GET request on the /todos end point with a pagination limit above the configured maximum to receive a 400 status code.

  • the maximum supported _limit value is 20
  • _limit=21 is too high for this API
  • this challenge is passed by receiving a 400 response for the invalid pagination request

Basic Instructions

  • Issue a GET request to end point "/todos"
    • https://apichallenges.com/todos
  • The request should have an X-CHALLENGER header to track challenge completion
  • Add _limit=21 as a URL parameter:
    • https://apichallenges.com/todos?_limit=21
  • The response status code should be 400 because the pagination limit is too high

Try it now

GET /todos?_limit=21 to trigger validation for a high limit

Example Request

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

Example Response

< HTTP/1.1 400 Bad Request
< Connection: close
< Content-Type: application/json
< X-Challenger: x-challenger-guid

The response body contains validation details explaining that the requested pagination limit is too high.

Experiment with this endpoint