All Products
Search
Document Center

GetSubscriptionAttributes

Last Updated: Oct 08, 2019

GetSubscriptionAttributes

Description

This API is used to obtain subscription attributes.

Request

A request includes the following parts:

  • Request line

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

  • Special request header

    None. For details, refer to Call method/Public parameters.

  • Request Body

    None

Response

The response message includes three parts: return status line, HTTP header, and message body.

  • HTTP Status Code

    HTTP/1.1 200 OK

  • Special response header

    None. For details, refer to Call method/Public parameters.

  • Response Body

Parameter name Description
SubscriptionName Name of the subscription
Subscriber Account ID of the subscriber
TopicOwner Account ID of the owner of the subscribed topic
TopicName Name of the subscribed topic
Endpoint Terminal address of the subscriber
NotifyStrategy Retry policy that will be applied when an error occurs during message push to the endpoint
NotifyContentFormat Format of the message content pushed to the endpoint
FilterTag Message filter tag in the subscription (Only messages with consistent tags are pushed.)
CreateTime Time when a subscription is created, defined as the number of seconds that have elapsed since 00:00:00, January 1, 1970
LastModifyTime Last modification time of subscription attributes, defined as the number of seconds that have elapsed since 00:00:00, January 1, 1970

Special Error

Error code Error message Status code
SubscriberNotExist The subscription you provided does not exist. 404

Request example:

  1. GET /topics/$TopicName/subscriptions/$SubscriptionName HTTP/1.1
  2. Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
  3. Date: Tue, 08 Dec 2015 06:09:58 GMT
  4. Authorization: MNS 15B4D3461F177624206A:GvaApggLQfMu6B6W5sbF6HEjV6Y=
  5. x-mns-version: 2015-06-06

Response example:

  1. HTTP/1.1 200 OK
  2. Content-Type=text/xml;utf-8
  3. Content-Length:451
  4. x-mns-request-id:56667436B2B71C9C16000029
  5. x-mns-version: 2015-06-06
  6. <?xml version="1.0" encoding="utf-8"?>
  7. <Subscription xmlns="http://mns.aliyuncs.com/doc/v1">
  8. <CreateTime>1449554806</CreateTime>
  9. <Endpoint>http://company.com</Endpoint>
  10. <FilterTag>important</FilterTag>
  11. <LastModifyTime>1449554962</LastModifyTime>
  12. <NotifyContentFormat>XML</NotifyContentFormat>
  13. <NotifyStrategy>BACKOFF_RETRY</NotifyStrategy>
  14. <SubscriptionName>$SubscriptionName</SubscriptionName>
  15. <Subscriber>$Subscriber</Subscriber>
  16. <TopicName>$TopicName</TopicName>
  17. <TopicOwner>$TopicOwner</TopicOwner>
  18. </Subscription>