Amazon Simple Queue Service
API Reference (API Version 2012-11-05)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

GetQueueUrl

Description

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 go to Shared Queues in the Amazon SQS Developer Guide.

Request Parameters

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

QueueName

The name of the queue whose URL must be fetched. Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

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 in a structure named GetQueueUrlResult.

QueueUrl

The URL for the queue.

Type: String

Errors

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

QueueDoesNotExist

The queue referred to does not exist.

HTTP Status Code: 400

Examples

The following example Query request gets the URL for the specified queue.

Sample Request

        
http://sqs.us-east-1.amazonaws.com/
?Action=GetQueueUrl
&QueueName=testQueue
&Version=2011-10-01
&SignatureMethod=HmacSHA256
&Expires=2011-10-24T22%3A52%3A43PST
&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
&SignatureVersion=2
&Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE

      

Sample Response

        
<GetQueueUrlResponse>
    <GetQueueUrlResult>
        <QueueUrl>
            http://&useast1-query;/123456789012/testQueue
        </QueueUrl>
    </GetQueueUrlResult>
    <ResponseMetadata>
        <RequestId>470a6f13-2ed9-4181-ad8a-2fdea142988e</RequestId>
    </ResponseMetadata>
</GetQueueUrlResponse>