Simple Todo List
A Simple todo list
Will accept json by default.
Content-Type: application/json
Set Content-Type header to application/xml if you want to send in XML.
Content-Type: application/xml
You can control the returned data format by setting the Accept header
You can request XML response by setting the Accept header.
i.e. for XML use
Accept: application/xml
You can request JSON response by setting the Accept header.
i.e. for JSON use
Accept: application/json
Some requests can be filtered by adding query params of fieldname=value. Where only matching items will be returned.
e.g. /items?size=2&status=true
All data lives in memory and is not persisted so the application is cleared everytime you start it. It does have some test data in here when you start
Model
Things
todo
Fields:- Mandatory?: true
- title : can not be empty
- Maximum allowable length exceeded for title - maximum allowed is 50
- Mandatory?: true
- Mandatory?: false
- Maximum allowable length exceeded for description - maximum allowed is 200
- Mandatory?: false
Fieldname | Type | Validation |
id | AUTO_INCREMENT | |
Example: "65" | ||
title | STRING | |
Example: "A title" | ||
doneStatus | BOOLEAN | |
Example: "false" | ||
description | STRING | |
Example: "my description" |
Example JSON Output from API calls
{
"id": 65,
"title": "A title",
"doneStatus": false,
"description": "my description"
}
Example XML Output from API calls
<todo>
<doneStatus>false</doneStatus>
<description>my description</description>
<id>65</id>
<title>A title</title>
</todo>
Example JSON Input to API calls
{
"title": "A title",
"doneStatus": false,
"description": "my description"
}
Example XML Input to API calls
<todo>
<doneStatus>false</doneStatus>
<description>my description</description>
<title>A title</title>
</todo>
Relationships
API
The API takes body with objects using the field definitions and examples shown in the model.
End Points
/todos
e.g. https://apichallenges.eviltester.com/todos
This endpoint can be filtered with fields as URL Query Parameters.
e.g. https://apichallenges.eviltester.com/todos?description=my%20description
-
GET /todos
- return all the instances of todo
-
HEAD /todos
- headers for all the instances of todo
-
POST /todos
- we should be able to create todo without a ID using the field values in the body of the message. A maximum of 20 todos is allowed.
/todos/:id
e.g. https://apichallenges.eviltester.com/todos/:id
-
GET /todos/:id
- return a specific instances of todo using a id
-
HEAD /todos/:id
- headers for a specific instances of todo using a id
-
POST /todos/:id
- amend a specific instances of todo using a id with a body containing the fields to amend
-
PUT /todos/:id
- amend a specific instances of todo using a id with a body containing the fields to amend
-
DELETE /todos/:id
- delete a specific instances of todo using a id
/docs
e.g. https://apichallenges.eviltester.com/docs
-
GET /https://apichallenges.eviltester.com/docs
- Show this documentation as HTML.
/challenger/:guid
e.g. https://apichallenges.eviltester.com/challenger/:guid
-
GET /challenger/:guid
- Get a challenger in Json format to allow continued tracking of challenges.
-
PUT /challenger/:guid
- Restore a saved challenger matching the supplied X-CHALLENGER guid to allow continued tracking of challenges.
/challenger
e.g. https://apichallenges.eviltester.com/challenger
-
POST /challenger
- Create a challenger using the X-CHALLENGER guid header.
/challenger/database/:guid
e.g. https://apichallenges.eviltester.com/challenger/database/:guid
-
GET /challenger/database/:guid
- Get the todo data for the supplied X-CHALLENGER guid to allow later restoration of the todos.
-
PUT /challenger/database/:guid
- Restore a saved set of todos for a challenger matching the supplied X-CHALLENGER guid.
/challenges
e.g. https://apichallenges.eviltester.com/challenges
-
GET /challenges
- Get list of challenges and their completion status
-
HEAD /challenges
- Headers for list of challenges endpoint
-
OPTIONS /challenges
- Options for list of challenges endpoint
/heartbeat
e.g. https://apichallenges.eviltester.com/heartbeat
-
GET /heartbeat
- Is the server running? YES 204
-
HEAD /heartbeat
- Headers for heartbeat endpoint
-
OPTIONS /heartbeat
- Options for heartbeat endpoint
/secret/token
e.g. https://apichallenges.eviltester.com/secret/token
-
POST /secret/token
- POST /secret/token with basic auth to get a secret/token to use as X-AUTH-TOKEN header, to allow access to the /secret/note end points.
/secret/note
e.g. https://apichallenges.eviltester.com/secret/note
-
GET /secret/note
- GET /secret/note with X-AUTH-TOKEN to return the secret note for the user.
-
POST /secret/note
- POST /secret/note with X-AUTH-TOKEN, and a payload of `{'note':'contents of note'}` to amend the contents of the secret note.
/mirror/request
e.g. https://apichallenges.eviltester.com/mirror/request
-
OPTIONS /mirror/request
- Options for mirror endpoint
-
GET /mirror/request
- Mirror a GET Request
-
POST /mirror/request
- Mirror a POST Request
-
PUT /mirror/request
- Mirror a PUT Request
-
DELETE /mirror/request
- Mirror a DELETE Request
-
PATCH /mirror/request
- Mirror a PATCH Request
-
TRACE /mirror/request
- Mirror a TRACE Request
-
HEAD /mirror/request
- Headers for mirror endpoint
/mirror/raw
e.g. https://apichallenges.eviltester.com/mirror/raw
-
OPTIONS /mirror/raw
- Options for mirror endpoint
-
GET /mirror/raw
- Raw Text Mirror of a GET Request
-
POST /mirror/raw
- Raw Text Mirror of a POST Request
-
PUT /mirror/raw
- Raw Text Mirror of a PUT Request
-
DELETE /mirror/raw
- Raw Text Mirror of a DELETE Request
-
PATCH /mirror/raw
- Raw Text Mirror of a PATCH Request
-
TRACE /mirror/raw
- Raw Text Mirror of a TRACE Request
-
HEAD /mirror/raw
- Headers for mirror endpoint