GetSubscriptionAttributes
Updated at:
Retrieves the properties of a subscription.
Authorization information
By default, only an Alibaba Cloud account can call this operation. A Resource Access Management (RAM) user can call this operation only after the required permissions are granted. The following table describes the authorization information for this operation. For more information, see Authorization policies and examples.
| Name | Value |
| API | GetSubscriptionAttributes |
| RAM authorization operation | mns:GetSubscriptionAttributes |
| Resource | acs:mns:$region:$accountid:/topics/$topicName/subscriptions/$subscriptionName |
Request message
A request message consists of a request line, HTTP headers, and a message body:
- Request line
GET /topics/$TopicName/subscriptions/$SubscriptionName HTTP/1.1 - Special request headers
None.
- Request body
None.
Response message
A response message consists of a status line, HTTP headers, and a message body:
- HTTP status code
HTTP/1.1 200 OK - Special response headers
None.
- Response body
Parameter Name Type Example Description SubscriptionName String MySubscription The name of the subscription. Subscriber String MyQueue The AccountId of the subscriber. TopicOwner String 123456789098**** The AccountId of the owner of the topic to which the subscription belongs. TopicName String MyTopic The name of the topic to which the subscription belongs. Endpoint String http://example.com The endpoint of the subscription. NotifyStrategy Boolean BACKOFF_RETRY The retry policy that is used when an error occurs when MNS pushes a message to an endpoint. Valid values:- BACKOFF_RETRY: backoff retry.
- EXPONENTIAL_DECAY_RETRY: exponential decay retry.
NotifyContentFormat Boolean XML The format of the message content that is pushed to the endpoint. Valid values:- XML
- JSON
- SIMPLIFIED
FilterTag String important The tag that is used for message filtering in the subscription. Only messages that have the same tag are pushed. CreateTime Long 1449554806 The time when the subscription was created. The value is the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970. LastModifyTime Long 1449554962 The time when the subscription properties were last modified. The value is the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970.
Examples
Request example:
GET /topics/$TopicName/subscriptions/$SubscriptionName HTTP/1.1
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
Date: Tue, 08 Dec 2015 06:09:58 GMT
Authorization: MNS 15B4D3461F177624206A:GvaApggLQfMu6B6W5sbF6HEj****
x-mns-version: 2015-06-06Response example:
HTTP/1.1 200 OK
Content-Type=text/xml;utf-8
Content-Length:451
x-mns-request-id:56667436B2B71C9C1600****
x-mns-version: 2015-06-06
<?xml version="1.0" encoding="utf-8"?>
<Subscription xmlns="http://mns.aliyuncs.com/doc/v1">
<CreateTime>1449554806</CreateTime>
<Endpoint>http://example.com</Endpoint>
<FilterTag>important</FilterTag>
<LastModifyTime>1449554962</LastModifyTime>
<NotifyContentFormat>XML</NotifyContentFormat>
<NotifyStrategy>BACKOFF_RETRY</NotifyStrategy>
<SubscriptionName>MySubscription</SubscriptionName>
<Subscriber>MyQueue</Subscriber>
<TopicName>MyTopic</TopicName>
<TopicOwner>123456789098****</TopicOwner>
</Subscription> Error codes
| Error code | Error message | HTTP status code | Description |
| SubscriptionNotExist | The subscription you provided does not exist. | 404 | The subscription does not exist. Create the subscription. |
Is this page helpful?