-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
It's madatory to provide the following http headers in every request (unless stated otherwise):
Content-Type: application/json
Accept: application/json
You most likely need to include the X-StoRe-Session: abcd1234
header for restricted content.
If you don't provide a session id and try to access restricted content the server responds the this with an 401 (Unauthorized) status code (unless stated otherwise).
Error 403 occurs (general speaking) if you try to access restricted content and don't have the right permissions to do so or the session id is simply invalid/expired.
The server responses with the status code 400 (Bad Request) if the client sends unparsable data e.g. an invalid json body.
Unknown request methods result in server error code 501 (Not Implemented).
Create a new session
{
"username": "foo",
"password": "bar"
}
Status | Description |
---|---|
200 Success | Your login request was successful. The session id always contains 8 lower case alphanumeric characters (a-z + 0-9). {"session_id": "abcd1234"}
|
403 Login Failed | Your username or password was incorrect. |
Delete a session (logging out)
The server takes the session provided by the client in the X-StoRe-Session
http header and destroys it.
Status | Description |
---|---|
200 Success | You're now logged out. |
Get a list of all the items
To save some bandwidth you can specify this HTTP header to only send an http body when it's actually necessary.
Status | Description |
---|---|
200 Success | The HTTP header Last-Modified contains the date of the most recent modification to an item.Json array of Items |
204 No Content | No items are stored. |
304 Not Modified | No changes since the specified date. |
Get the specified item
To save some bandwidth you can specify this HTTP header to only send an http body when it's actually necessary.
Status | Description |
---|---|
200 Success | The HTTP header Last-Modified contains the date of the last modification to the item.The body contains your specified Item. |
304 Not Modified | No changes since the specified date. |
404 Not Found | The specified item couldn't be found. |
Create a new item
Item datatype without item_id
field.
Status | Description |
---|---|
201 Created | {"item_id": <item_id>} |
404 Not Found | The request contained invalid data. e.g. an unknown tag id |
Update an existing item
Item datatype without item_id
field.
If you wish to only update the item if it hasn't been modified. Otherwise the server will forcefully overwrite the item.
Status | Description |
---|---|
200 Success | The item has been updated. |
409 Conflict | The item has been updated since the specified date. |
404 Not Found | The request contained invalid data. e.g. an unknown tag id |
Delete the specified item
Status | Description |
---|---|
200 Success | The item has been deleted. |
404 Not Found | The specified item couldn't be found. |
409 Conflict | There is an item that depends on this tag. |
Get a list of all tags
Status | Description |
---|---|
200 Success | Json array of Tags |
204 No Content | No tags are defined. |
Create a new tag
Tag datatype without tag_id
field.
Status | Description |
---|---|
201 Created | {"tag_id": <tag_id>} |
Update an existing tag
Tag datatype without tag_id
field.
Status | Description |
---|---|
200 Success | The tag has been updated. |
404 Not Found | The specified tag couldn't be found. |
409 Conflict | This tag name already exists. |
Delete the specified tag
Status | Description |
---|---|
200 Success | The tag has been deleted. |
404 Not Found | The specified tag couldn't be found. |