This API exposes functionality to store and manage Things, which are JSON objects.
This project uses Pipenv.
# install dependencies
pipenv install
# run unit tests
pipenv run test
GET /health
200 OK
POST /thing
Content-Type: application/json
ThingRequest
201 Created
Location: /thing/{thingId}
GET /thing
200 OK
Content-Type: application/json
{
things: Thing[]
}
GET /thing/{thingId}
200 OK
Content-Type: application/json
Thing
PUT /thing/{thingId}
Content-Type: application/json
ThingRequest
204 No Content
DELETE /thing/{thingId}
204 No Content
400 Bad Request
Content-Type: application/json
ErrorResponse
404 Not Found
Content-Type: application/json
ErrorResponse
500 Internal Server Error
Content-Type: application/json
ErrorResponse
{
error: string
}
Field | Type | Description |
---|---|---|
error |
string |
Error message indicating which error was thrown |
{
thingId: string,
modelKey: string,
...
}
Field | Type | Description |
---|---|---|
thingId |
string |
Unique identifier for the Thing |
modelKey |
string |
Key indicating the type of Thing |
Additional fields | (valid JSON) | Users can specify any additional fields |
{
modelKey: string,
...
}
Field | Type | Description |
---|---|---|
modelKey |
string |
Key indicating the type of Thing |
Additional fields | (valid JSON) | Users can specify any additional fields |
The thingId
field will be ignored in a ThingRequest
payload if included; use the Replace a Thing (PUT
) endpoint if you want to create a Thing with a predefined thingId
.