GetQueueAttributes

Gets one or all attributes of a queue. Queues currently have two attributes you can get:

[Important]Important

Before the 2007-05-01 release introduced the GetQueueAttributes action, you retrieved the visibility timeout by using the GetVisibilityTimeout action. As of the 2007-05-01 release of Amazon SQS, the GetVisibilityTimeout action has been deprecated.

The following table lists the special request parameters the action uses (in addition to the common request parameters listed in Common Request Parameters).

NameDescriptionRequired

Attribute

The attribute you want to get. Setting this value to All returns all the queue's attributes.

Type: String

Valid values: All | ApproximateNumberOfMessages | VisibilityTimeout

Yes

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

NameDescription

Attribute

The attribute.

Type: String

Valid Values: ApproximateNumberOfMessages | VisibilityTimeout

Ancestor: AttributedValue

AttributedValue

An element containing each attribute's information.

Ancestor: GetQueueAttributesResponse

Child: Attribute, Value

Value

The value for the attribute.

Type: String

Ancestor: AttributedValue

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

ErrorDescriptionHTTP Status Code

InvalidAttributeName

Unknown attribute

400

The following example Query request gets all the attribute values for the specified queue.