Menu
Amazon Simple Queue Service
API Reference (API Version 2012-11-05)

GetQueueUrl

Returns the URL of an existing queue. This action provides a simple way to retrieve the URL of an Amazon SQS queue.

To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId parameter to specify the account ID of the queue's owner. The queue's owner must grant you permission to access the queue. For more information about shared queue access, see AddPermission or see Shared Queues in the Amazon Simple Queue Service Developer Guide.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

QueueName

The name of the queue whose URL must be fetched. Maximum 80 characters. Valid values: alphanumeric characters, hyphens (-), and underscores (_).

Queue names are case-sensitive.

Type: String

Required: Yes

QueueOwnerAWSAccountId

The AWS account ID of the account that created the queue.

Type: String

Required: No

Response Elements

The following element is returned by the service.

QueueUrl

The URL of the queue.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AWS.SimpleQueueService.NonExistentQueue

The queue referred to doesn't exist.

HTTP Status Code: 400

Example

The following example Qquery request gets the URL for the specified queue. How you structure the AUTHPARAMS depends on how you are signing your API request. For information about AUTHPARAMS in Signature Version 4, see Examples of Signed Signature Version 4 Requests in the Amazon Web Services General Reference.

Sample Request

http://sqs.us-east-2.amazonaws.com/ ?Action=GetQueueUrl &QueueName=testQueue &Version=2012-11-05 &Expires=2020-10-24T22%3A52%3A43PST &AUTHPARAMS

Sample Response

<GetQueueUrlResponse> <GetQueueUrlResult> <QueueUrl> http://sqs.us-east-2.amazonaws.com/123456789012/testQueue </QueueUrl> </GetQueueUrlResult> <ResponseMetadata> <RequestId>470a6f13-2ed9-4181-ad8a-2fdea142988e</RequestId> </ResponseMetadata> </GetQueueUrlResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: