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.

NameValue
APIGetSubscriptionAttributes
RAM authorization operationmns:GetSubscriptionAttributes
Resourceacs: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 NameTypeExampleDescription
    SubscriptionNameStringMySubscriptionThe name of the subscription.
    SubscriberStringMyQueueThe AccountId of the subscriber.
    TopicOwnerString123456789098****The AccountId of the owner of the topic to which the subscription belongs.
    TopicNameStringMyTopicThe name of the topic to which the subscription belongs.
    EndpointStringhttp://example.comThe endpoint of the subscription.
    NotifyStrategyBooleanBACKOFF_RETRYThe 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.
    For more information about retry policies, see NotifyStrategy.
    NotifyContentFormatBooleanXMLThe format of the message content that is pushed to the endpoint.
    Valid values:
    • XML
    • JSON
    • SIMPLIFIED
    For more information about message formats, see NotifyContentFormat.
    FilterTagStringimportantThe tag that is used for message filtering in the subscription. Only messages that have the same tag are pushed.
    CreateTimeLong1449554806The 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.
    LastModifyTimeLong1449554962The 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-06

Response 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 codeError messageHTTP status codeDescription
SubscriptionNotExistThe subscription you provided does not exist.404The subscription does not exist. Create the subscription.