How to complete the challenge GET /todos (200) ?filter&_limit&_offset
How to issue a GET request on a top level entity endpoint and combine a todo field filter with pagination.
GET /todos (200) ?filter&_limit&_offset
Issue a GET request on the
/todosend point with a query filter and pagination parameters.
doneStatus=falsefilters the collection to only not done todos_limit=2asks for 2 returned todos_offset=1skips 1 todo after filtering- filtering is applied before pagination
- if your current session has fewer matching todos after the offset, the response will contain fewer todos
Basic Instructions
- Issue a
GETrequest to end point "/todos"https://apichallenges.eviltester.com/todos
- The request should have an
X-CHALLENGERheader to track challenge completion - Add
doneStatus=false,_limit=2, and_offset=1as URL parameters:https://apichallenges.eviltester.com/todos?doneStatus=false&_limit=2&_offset=1
- The response status code should be
200because the request is accepted - Check that the response body contains no more than 2 todos and all returned todos have
doneStatusset tofalse
Try it now
Example Request
> GET /todos?doneStatus=false&_limit=2&_offset=1 HTTP/1.1
> Host: apichallenges.eviltester.com
> User-Agent: rest-client
> X-CHALLENGER: x-challenger-guid
> Accept: application/json
Example Response
< HTTP/1.1 200 OK
< Connection: close
< Content-Type: application/json
< X-Challenger: x-challenger-guid
Returned body:
{
"todos": [
{ "id": 2, "title": "not done todo", "doneStatus": false, "description": "" },
{ "id": 3, "title": "another not done todo", "doneStatus": false, "description": "" }
]
}