X-Auth-Token
header.Content-Type
header. The request format is
+ .json
extension to the request URI. JSON is also used for the response
+ format.Format | +Accept Header | +Query Extension | +Default | +
JSON | +application/json | +.json | +Yes | +
Type | +Description | +Limit | +Default | +
---|---|---|---|
Limits on Messages and Queues per Request | +Number of queue records per page of results when listing queues | +1 - 1000 | +20 | +
Number of messages per page of results when listing messages | +1 - 25 | +20 | +|
Number of messages that can be posted in a single request | +1 - 25 | +20 | +|
Number of messages that can be claimed at one time | +1 - 25 | +20 | +|
Number of messages that can be deleted in a single bulk delete request | +1 - 25 | +20 | +|
Number of messages that can be requested in a bulk get by ID | +1 - 25 | +20 | +|
Time Limits | +Valid range for a message TTL | +60 - 1209600 seconds (1 minute to 14 days) | +1209600 seconds | +
Valid range for a claim TTL | +60 - 43200 seconds (1 minute to 12 hours) | +43200 seconds | +|
Valid range for claim grace period | +60 - 43200 seconds (1 minute to 12 hours) | +43200 seconds | +|
Data Limits | +Queue metadata JSON | +Cannot exceed 262144 bytes, including whitespace (256 KB) | +65536 bytes | +
Message body JSON | +Cannot exceed 262144 bytes, including whitespace (256 KB) | +262144 bytes | +
Header | +Description | +
---|---|
Host | +Host name of the API | +
Date | +Current date and time | +
Accept | +Media type desired; initially, only
+ application/json is supported. Accept header is
+ required. |
+
Accept-Encoding | +Specifies that the agent accepts gzip-encoded response + bodies | +
Content-Type | +application/json
+ |
+
Content-Length | +For |
+
X-Auth-Token | +Auth token | +
X-Project-Id | +An ID for a project to which the value of X-Auth-Token + grants access. Queues are created under this + project. | +
Client-ID | +A UUID for each client instance. The UUID must be
+ submitted in its canonical form (for example,
+ 3381af92-2b9e-11e3-b191-71861300734c). The client
+ generates the Client-ID once. Client-ID persists between
+ restarts of the client so the client should reuse that
+ same Client-ID. Client-ID in the headers to ensure that
+ messages are not echoed back to the client that posted
+ them, unless the client explicitly requests
+ this. |
+
Code | +Description | +
yyyy | +Four-digit year | +
MM | +Two-digit month | +
dd | +Two-digit day of at the month | +
T | +Separator for date and time | +
HH | +Two-digit hour of the day (00-23) | +
mm | +Two-digit minutes of the hour | +
ss | +Two-digit seconds of the minute | +
SSS | +Three-digit milliseconds of the second | +
Z | +RFC 822 time zone | +
HTTP Response Code | +Description | +
201 | +Success (created) | +
204 | +Success (already exists) | +
400 | +Queue has a long name (greater than 64 bytes) | +
400 | +Request header has missing fields | +
401 | +Request header has invalid auth token | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Success | +
200 | +URI has invalid parameter (something other than
+ |
+
204 | +Request with non-existing value for
+ |
+
400 | +Request with negative value for
+ |
+
400 | +Request with zero value for
+ |
+
400 | +Request with non-boolean value for
+ |
+
400 | +Header has missing fields | +
401 | +Request header has invalid auth token | +
404 | +Request a non-existing queue | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +URI has invalid parameters | +
204 | +Success | +
204 | +Delete a non-existing queue | +
400 | +Header has missing fields | +
401 | +Request header has invalid auth token | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
204 | +Check a non-existing queue | +
404 | +Request a non-existing queue | +
HTTP Response Code | +Description | +
204 | +Success | +
400 | +Request body is empty | +
400 | +Request body is greater than 64 KB | +
400 | +Request body has malformed JSON | +
400 | +Request with non-JSON body | +
406 | +Request header has Accept != + "application/json" | +
429 | +Too many requests | +
+ | Request with UTF-16 char JSON body | +
HTTP Response Code | +Description | +
200 | +Success | +
200 | +No metadata exists for the queue | +
200 | +URI has invalid parameters | +
400 | +Header has missing fields | +
401 | +Request header has invalid auth token | +
404 | +Request metadata for a non-existing queue | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Success | +
200 | +URI has invalid parameters | +
400 | +Header has missing fields | +
401 | +Request header has invalid auth token | +
404 | +Request stats for a non-existing queue | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +URI has invalid parameters | +
201 | +Success | +
201 | +Post multiple messages in a single request, few of
+ them succeed (with |
+
400 | +Post greater than 100 messages with a single + request | +
400 | +Post with request body greater than 4 KB | +
400 | +Post with invalid JSON request body | +
400 | +Post with non-JSON request body | +
400 | +Post with non-JSON message | +
400 | +Post with TTL less than 60 | +
400 | +Post with TTL greater than 1209600 | +
400 | +Post with non-integer value of TTL | +
400 | +Post with negative value of TTL | +
400 | +Post without TTL in request body | +
400 | +Post without |
+
400 | +Post with no request body | +
400 | +Post with messages encapsulated in multiple + arrays | +
400 | +Header has missing fields | +
401 | +Header has invalid auth token | +
404 | +Post message to a non-existing queue | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
503 | +Post multiple messages in a single request and all + of them fail | +
HTTP Response Code | +Description | +
200 | +Success (query matched 1 or more messages) | +
200 | +Request message with invalid parameter (something
+ other than |
+
204 | +Success (query has no match) | +
204 | +Request message with non-existing
+ |
+
400 | +Request message with limit greater than 100 | +
400 | +Post with request body greater than 4 KB | +
400 | +Request message with limit less than or equal to 0 + | +
400 | +Request message with non-boolean value for
+ |
+
401 | +Header has invalid auth token | +
404 | +Request message from a non-existing queue | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Success | +
200 | +URI has invalid parameters | +
400 | +Request message with limit greater than 100 | +
401 | +Post with request body greater than 4 KB | +
404 | +Request message with limit less than or equal to 0 + | +
404 | +Request message with non-boolean value for
+ |
+
406 | +Header has invalid auth token | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
204 | +Success | +
204 | +Delete message from a non-existing queue | +
204 | +Delete a non-existing message | +
400 | +Header has missing fields | +
401 | +Header has invalid auth token | +
403 | +Delete with expired claim ID | +
403 | +Delete with non-existing claim ID | +
403 | +Delete claimed message without providing a claim + ID | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Success(query matched the message) | +
200 | +URI has invalid parameters | +
400 | +Header has missing fields | +
401 | +Header has invalid auth token | +
404 | +Request message from a non-existing queue | +
404 | +Request a non-existing message | +
404 | +Request an expired message | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +URI has invalid parameters | +
204 | +Success | +
204 | +Delete message from a non-existing queue | +
204 | +Delete a non-existing message | +
400 | +Header has missing fields | +
401 | +Header has invalid auth token | +
403 | +Delete with expired claim ID | +
403 | +Delete with non-existing claim ID | +
403 | +Delete claimed message without providing a claim + ID | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
201 | +Success | +
204 | +Success (empty queue with no messages to + claim) | +
204 | +Claim message from a non-existing queue | +
400 | +Claim message with invalid value for
+ |
+
400 | +Claim message with |
+
400 | +Claim message with no request body | +
400 | +Claim message with no TTL field | +
400 | +Claim message with invalid TTL value (non-integer, + or less than or equal to 0) | +
400 | +Claim message with invalid JSON | +
400 | +Claim message with non-JSON request body | +
400 | +Claim message with missing header fields | +
401 | +Claim message with invalid auth token | +
404 | +Item not found | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Success | +
200 | +Query claim with invalid URI parameters | +
400 | +Query claim with missing header fields | +
401 | +Query claim with invalid auth token | +
404 | +Query expired claim | +
404 | +Query claim from a non-existing queue | +
404 | +Query claim with non-existing claim ID | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Update claim with invalid URI parameters | +
204 | +Success | +
400 | +Update claim with no request body | +
400 | +Update claim with invalid JSON in request body + | +
400 | +Update claim with non-JSON request body | +
400 | +Update claim with missing header fields | +
401 | +Update claim with invalid auth token | +
404 | +Update expired claim | +
404 | +Update claim on a non-existing queue | +
404 | +Update a non-existing claim | +
406 | +Update claim with content-type != + application/json-patch | +
429 | +Too many requests | +
HTTP Response Code | +Description | +
200 | +Release claim with invalid URI parameters | +
204 | +Success | +
204 | +Release expired claim | +
204 | +Release a non-existing claim | +
400 | +Release claim with missing header fields | +
401 | +Release claim with invalid auth token | +
404 | +Release claim from a non-existing queue | +
406 | +Header has Accept != "application/json" | +
429 | +Too many requests | +
Option | +Description | +
---|---|
-d |
+ Sends the specified data in a
+ POST request to the HTTP
+ server. |
+
-i |
+ Includes the HTTP header in the + output. | +
-H HEADER |
+ Specifies an HTTP header in the + request. | +
-X |
+ Specifies the request method to use when
+ communicating with the HTTP server. The
+ specified request is used instead of the
+ default method, which is GET. For example,
+ -X PUT specifies to use
+ the PUT request method. |
+
X-Auth-Token
header.Header | +Description | +
---|---|
Host | +Host name of the API | +
Date | +Current date and time | +
Accept | +Media type to use. Initially, only
+ application/json is
+ supported. Accept header is
+ required. |
+
Accept-Encoding | +Specifies that the agent accepts gzip-encoded + response bodies | +
Content-Type | +application/json |
+
Content-Length | +For |
+
X-Auth-Token | +Authorization token | +
X-Project-Id | +An ID for a project to which the value of + X-Auth-Token grants access. Queues are created + under this project. The project ID is the same + as the account ID (also sometimes called + tenant ID). | +
Client-ID | +A UUID for each client instance. The UUID must
+ be submitted in its canonical form (for
+ example,
+ 3381af92-2b9e-11e3-b191-71861300734c). The
+ client generates the Client-ID once. Client-ID
+ persists between restarts of the client so the
+ client should reuse that same Client-ID.
+ Client-ID in the headers
+ to ensure that messages are not echoed
+ back to the client that posted them,
+ unless the client explicitly requests
+ this. |
+
body
field
+ values as it was earlier releases). On
+ error, the client is notified of by how
+ much the request exceeded the
+ limit.204 No Content
response
+ code.queue_name
is the name that you give to the queue. The name must not exceed 64 bytes in length, and it is limited to US-ASCII letters, digits, underscores, and hyphens.false
, which excludes the metadata.
+ queue_name
is the name that you give to the queue. The name must not exceed 64 bytes in length, and it is limited to US-ASCII letters, digits, underscores, and hyphens.queue_name
is the name that you give to the queue. The name must not exceed 64 bytes in length, and it is limited to US-ASCII letters, digits, underscores, and hyphens.total
attribute is 0, then oldest
and newest
message statistics are not included in the response.queue_name
is the name that you give to the queue. The name must not exceed 64 bytes in length, and it is limited to US-ASCII letters, digits, underscores, and hyphens.queue_name
is the name that you give to the queue. The name must not exceed 64 bytes in length, and it is limited to US-ASCII letters, digits, underscores, and hyphens.503 Service Unavailable
error message.body
attribute specifies an arbitrary document that constitutes the body of the message being sent.ttl
attribute specifies how long the server waits before marking the message as expired and removing it from the queue. The value of ttl
must be between 60 and 1209600 seconds (14 days). Note that the server might not actually delete the message until its age has reached up to (ttl + 60) seconds, to allow for flexibility in storage implementations.marker
parameter communicates to the server which messages the client has already received. If you do not specify a value, the API returns all messages at the head of the queue (up to the limit).
+ echo
parameter is a Boolean value (true
or false
) that determines whether the API returns a client's own messages, as determined by the uuid
portion of the User-Agent header. If you do not specify a value, echo
uses the default value of false
. If you are experimenting with the API, you might want to set echo=true
in order to see the messages that you posted.
+ include_claimed
parameter is a Boolean value (true
or false
) that determines whether the API returns claimed messages and unclaimed messages. If you do not specify a value, include_claimed
uses the default value of false
(only unclaimed messages are returned).
+ href
is an opaque relative URI that the client can use to uniquely identify a message resource and interact with it.ttl
is the TTL that was set on the message when it was posted. The message expires after (ttl - age) seconds.age
is the number of seconds relative to the server's clock.body
is the arbitrary document that was submitted with the original request to post the message.href
is an opaque relative URI that the client can use to uniquely identify a message resource and interact with it.ttl
is the TTL that was set on the message when it was posted. The message expires after (ttl - age) seconds.age
is the number of seconds relative to the server's clock.body
is the arbitrary document that was submitted with the original request to post the message.claim_id
parameter specifies that the message is deleted only if it has the specified claim ID and that claim has not expired. This specification is useful for ensuring only one worker processes any given message. When a worker's claim expires before it can delete a message that it has processed, the worker must roll back any actions it took based on that message because another worker can now claim and process the same message.claim_id
, but the message is claimed, the operation fails. You can only delete claimed messages by providing an appropriate claim_id
.limit
parameter) from oldest to newest and skips any messages that are already claimed. If no unclaimed messages are available, the API returns a 204 No Content
message.ttl
attribute specifies how long the server waits before releasing the claim. The ttl value must be between 60 and 43200 seconds (12 hours). You must include a value for this attribute in your request.grace
attribute specifies the message grace period in seconds. The value of grace
value must be between 60 and 43200 seconds (12 hours). You must include a value for this attribute in your request. To deal with workers that have stopped responding (for up to 1209600 seconds or 14 days, including claim lifetime), the server extends the lifetime of claimed messages to be at least as long as the lifetime of the claim itself, plus the specified grace period. If a claimed message would normally live longer than the grace period, its expiration is not adjusted.