Support this site by joining our Patreon. For as little as $1 a month you receive exclusive ad-free content, ebooks and online training courses. - Learn more
Simulation Mode
A simulated API, each request generates a new set of data but responses are processed by an API handler.
A simulated API, where each request is run against a new generated set of data but responses are processed by an API handler.
No data is stored on the server.
The simulator is designed to be used by following along with the instructions otherwise sequential requests will not make sense e.g. if you DELETE an item and then GET it, then it will be returned because the simulator expects you to DELETE a specific item.
Model
Things
entity
Fields:| Fieldname | Type | Description |
| id | AUTO_INCREMENT |
|
| Example: "36" | ||
| name | STRING |
|
| Example: "unnamed" | ||
| description | STRING |
|
| Example: "" | ||
Example JSON Output from API calls
{
"id": 36,
"name": "unnamed",
"description": ""
}
Example XML Output from API calls
<entity>
<name>unnamed</name>
<description/>
<id>36</id>
</entity>
Example JSON Input to API calls
{
"id": 1,
"name": "unnamed",
"description": ""
}
Example XML Input to API calls
<entity>
<name>unnamed</name>
<description/>
<id>1</id>
</entity>
API
The API takes body with objects using the field definitions and examples shown in the model.
End Points
/sim/entities
e.g. /sim/entities
This endpoint can be filtered with fields as URL Query Parameters.
e.g. /sim/entities?name=unnamed
This endpoint can be sorted with the _sortBy URL Query Parameter. Use _sortBy=+field or _sortBy=field for ascending order, and _sortBy=-field for descending order. Multiple fields can be combined with commas, e.g. _sortBy=+field,-other.
e.g. /sim/entities?_sortBy=+id
-
GET /sim/entities
- return all the instances of entity
-
QUERY /sim/entities
- query all the instances of entity using application/x-www-form-urlencoded query content
QUERY content uses Content-Type: application/x-www-form-urlencoded with fields such as title=Task&_sortBy=-id.
-
HEAD /sim/entities
- headers for all the instances of entity
-
POST /sim/entities
- we should be able to create entity without a ID using the field values in the body of the message.
-
OPTIONS /sim/entities
- show all Options for endpoint of /sim/entities
/sim/entities/:id
e.g. /sim/entities/:id
-
GET /sim/entities/:id
- return a specific instances of entity using a id
-
HEAD /sim/entities/:id
- headers for a specific instances of entity using a id
-
POST /sim/entities/:id
- amend a specific instances of entity using a id with a body containing the fields to amend
-
PUT /sim/entities/:id
- amend a specific instances of entity using a id with a body containing the fields to amend
-
DELETE /sim/entities/:id
- delete a specific instances of entity using a id
-
OPTIONS /sim/entities/:id
- show all Options for endpoint of /sim/entities/:id
- OpenAPI v 3.0 JSON [standard validation] [download] - [less validation] [download]
- OpenAPI v 3.1 JSON [standard validation] [download] - [less validation] [download]
- OpenAPI v 3.2 JSON [standard validation] [download] - [less validation] [download]
Support this site by joining our Patreon. For as little as $1 a month you receive exclusive ad-free content, ebooks and online training courses. - Learn more