Queries the parameters of a subscription.

Authorization

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after these RAM users are granted related permissions. The following table describes the authorization information of this operation. For more information, see Permission policies and examples.

Item Value
API operation GetSubscriptionAttributes
Action mns:GetSubscriptionAttributes
Resource acs:mns:$region:$accountid:/topics/$topicName/subscriptions/$subscriptionName

Request

A request consists of the following parts:

  • Request line

    GET /topics/$TopicName/subscriptions/$SubscriptionName HTTP/1.1

  • Operation-specific request headers

    None.

  • Request body

    None.

Response

A response consists of the following parts:

  • HTTP status code

    HTTP/1.1 200 OK

  • Operation-specific response headers

    None.

  • Response body
    Parameter Type Example Description
    SubscriptionName String MySubscription The name of the subscription.
    Subscriber String MyQueue The account ID of the subscriber.
    TopicOwner String 123456789098**** The account ID of the topic owner.
    TopicName String MyTopic The name of the topic.
    Endpoint String http://example.com The endpoint to which the messages are pushed.
    NotifyStrategy Boolean BACKOFF_RETRY The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    Valid values:
    • BACKOFF_RETRY: retries with a fixed backoff interval.
    • EXPONENTIAL_DECAY_RETRY: retries with exponential backoff.
    For more information, see NotifyStrategy.
    NotifyContentFormat Boolean XML The content format of the messages that are pushed to the endpoint.
    Valid values:
    • XML
    • JSON
    • SIMPLIFIED
    For more information, see NotifyContentFormat.
    FilterTag String important The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    CreateTime Long 1449554806 The time when the subscription was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    LastModifyTime Long 1449554962 The time when the subscription was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Examples

Sample requests

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

Sample success responses

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 error message returned because the specified subscription does not exist. Create a subscription.