All responses are in JSON. They all use the following format:
{
"success": true, /* request succeeded */
"message": null, /* contains an error message if success is false */
"payload": null, /* contains the response if success is true */
}
All responses can have a 500 error code, this means that the server has failed.
The server has the option to enable authentication. If this is the case, the
authentication should be sent as HTTP Basic authentication, which is with the
header Authorization: base64_encode(username ':' password)
. See
Security.md for authorization setup details.
- /queues [GET] - List all queues
- /queues [POST] - Create new queue
- /queue [POST] - List queue information
- /queue [DELETE] - Delete queue
- /take [POST] - Take item from queue
- /peek [POST] - Peek at item in queue
- /put [POST] - Put item in queue
- /take/ws [WebSocket] - Wait for item in queue
List all of the queues currently available
{
"success": true,
"message": null,
"payload": [
"8a672d01-0daa-47c5-8d2e-c55c93fc71c2",
"e2e0b44e-e636-48d7-9602-178e7403ef77"
/* additional queue ids */
]
}
Create a new queue
- name - optional, name of the new queue to create
{
"success": true,
"message": null,
"payload": "e2e0b44e-e636-48d7-9602-178e7403ef77" /* name of the new queue */
}
- 400 -
name
parameter is not a uuid
Get information about a queue
- name - name of the queue
{
"success": true,
"message": null,
"payload": {
"name": "e2e0b44e-e636-48d7-9602-178e7403ef77"
}
}
- 400 -
name
parameter is not a uuid - 404 -
name
is not an existing queue
Delete a queue
- name - name of the queue
{
"success": true,
"message": null,
"payload": null
}
- 400 -
name
parameter is not a uuid - 404 -
name
is not an existing queue
Take an item from the queue
- name - name of the queue
- key - optional, key required to take item
{
"success": true,
"message": null,
"payload": {
"key": null, /* item key if present */
"value": "" /* item value */
}
}
- 400 -
name
parameter is not a uuid - 404 -
name
is not an existing queue, or no item was found in the queue
Peek at an item in the queue without removing it
- name - name of the queue
- key - optional, key required to peek item
{
"success": true,
"message": null,
"payload": {
"key": null, /* item key if present */
"value": "" /* item value */
}
}
- 400 -
name
parameter is not a uuid - 404 -
name
is not an existing queue, or no item was found in the queue
Put a new item in the queue
- name - name of the queue
- value - value of the item to add to the queue
- key - optional, key of the item to add to the queue
{
"success": true,
"message": null,
"payload": null
}
- 400 -
name
parameter is not a uuid orvalue
parameter is missing - 404 -
name
is not an existing queue
Request notification for queue item
{
"identifier": "random-string", /* uniqueue identifier for this request */
"queue": "e2e0b44e-e636-48d7-9602-178e7403ef77", /* queue id */
"key": "mykey" /* optional, key required to match */
}
Error (Sent at any time)
{
"success": false,
"message": "failed to create want", /* one possible error message */
"payload": null
}
Item Received (One to one response to requests, not necessarily in order)
{
"success": true,
"message": null,
"payload": {
"id": "random-string", /* unique identifier from request */
"item": {
"key": null, /* item key */
"value": "" /* item value */
}
}
}