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?: false
- : can not be empty
- Mandatory?: true
- Mandatory?: false
- Mandatory?: false
Fieldname | Type | Validation |
id | ID | |
Example: "68" | ||
title | STRING | |
Example: "onsectetur adipiscin" | ||
doneStatus | BOOLEAN | |
Example: "true" | ||
description | STRING | |
Example: "atur. Excepteur sint" |
Example JSON Output from API calls
{
"id": 68,
"title": "onsectetur adipiscin",
"doneStatus": true,
"description": "atur. Excepteur sint"
}
Example XML Output from API calls
<todo>
<doneStatus>true</doneStatus>
<description>atur. Excepteur sint</description>
<id>68</id>
<title>onsectetur adipiscin</title>
</todo>
Example JSON Input to API calls
{
"title": "onsectetur adipiscin",
"doneStatus": true,
"description": "atur. Excepteur sint"
}
Example XML Input to API calls
<todo>
<doneStatus>true</doneStatus>
<description>atur. Excepteur sint</description>
<title>onsectetur adipiscin</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.herokuapp.com/todos
This endpoint can be filtered with fields as URL Query Parameters.
e.g. https://apichallenges.herokuapp.com/todos?doneStatus=true
-
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
/todos/:id
e.g. https://apichallenges.herokuapp.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.herokuapp.com/docs
-
GET /https://apichallenges.herokuapp.com/docs
- Show this documentation as HTML.
/challenger
e.g. https://apichallenges.herokuapp.com/challenger
-
POST /challenger
- Create an X-CHALLENGER guid to allow tracking challenges, use the X-CHALLENGER header in all requests to track challenge completion for multi-user tracking.
/challenger/:guid
e.g. https://apichallenges.herokuapp.com/challenger/:guid
-
GET /challenger/:guid
- Restore a saved challenger matching the supplied X-CHALLENGER guid to allow continued tracking of challenges.
/challenges
e.g. https://apichallenges.herokuapp.com/challenges
-
GET /challenges
- Get list of challenges and their completion status
-
OPTIONS /challenges
- Options for list of challenges endpoint
-
HEAD /challenges
- Headers for list of challenges endpoint
/heartbeat
e.g. https://apichallenges.herokuapp.com/heartbeat
-
GET /heartbeat
- Is the server running? YES 204
-
OPTIONS /heartbeat
- Options for heartbeat endpoint
-
HEAD /heartbeat
- Headers for heartbeat endpoint
/secret/token
e.g. https://apichallenges.herokuapp.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.herokuapp.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.herokuapp.com/mirror/request
-
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
-
OPTIONS /mirror/request
- Options for mirror endpoint
-
HEAD /mirror/request
- Headers for mirror endpoint