PUT on MessageQueue

The PUT on MessageQueue action does one of the following:

To send a message, you must append "/back" to the queue URL (see the example below). You specify the content of the message in the body of the HTTP request, and the content can be any string that does not exceed 256 KB.

[Important]Important

The following list shows the binary characters (in Unicode) allowed in your message, according to http://www.w3.org/TR/REC-xml/#charsets. If you send any binary characters not included in the list, your request will be rejected.

#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

The following table lists the special request parameters the action uses (in addition to the common request headers listed in Common REST Headers).

NameDescriptionRequired

The message text

The message to send, which you provide as the HTTP body (see the example below). Make sure to append "/back" to the queue URL when sending a message.

Type: String

Constraints: Maximum size of 256 KB. See the important note above for a list of allowed characters.

Condition: Required when sending a message

Conditional

VisibilityTimeout

The duration (in seconds) that messages are hidden from subsequent GET on MessageQueue requests. See Visibility Timeout for more information. Do not append "/back" to the URL when setting the visibility timeout.

Type: Integer from 0 to 86400 (maximum 24 hours)

Condition: Required when setting the visibility timeout

Conditional

The following table lists the response elements the action returns (in addition to the common response elements listed in The Structure of a Response).

NameDescription

MessageId

An element containing the message ID of the message sent to the queue. You use this value when performing actions on that message. This element is returned only if you're using the action to send a message to the queue.

Type: String

Ancestor: SendMessageResponse

The following table lists the special errors the action returns (in addition to the common errors listed in Common Errors).

ErrorDescriptionHTTP Status Code

InvalidMessageContents

The message contains characters outside the allowed set.

400

[Important]Important

When specifying a queue when using the REST API, make sure to omit http://queue.amazon.aws.com from the queue URL and provide only what's left (/A29E9WXPHGOG29/queue1 in the following examples).