Lists all subscriptions to a topic. The subscriptions are displayed by page.

Description

You can call this operation to list all subscriptions to a topic. The subscriptions are displayed by page.

Note If the total number of subscriptions exceeds the value of the x-mns-ret-number parameter that is specified in the request, the NextMarker parameter that indicates the start position of the next page is returned. When you send another request to query the remaining subscriptions, you must set the x-mns-marker parameter to the returned value of the NextMarker parameter.

Request

Each request consists of the following parts:

  • Request line

    GET /topics/$TopicName/subscriptions HTTP/1.1

  • Operation-specific request headers
    Parameter Required Description
    x-mns-prefix No The prefix that subscriptions to be queried.
    x-mns-marker No The start position of the page. You can retrieve the value of this parameter from the NextMarker parameter in the previous response.
    x-mns-ret-number No The maximum number of subscriptions that can be returned for the request. Valid values: 1 to 1000. Data type: integer. Default value: 1000.

    For more information about common request headers, see Common parameters.

  • Request Body

    None.

Response

Each response consists of the following parts:

  • HTTP Status Code

    HTTP/1.1 200 OK

  • Operation-specific response headers

    None. For more information about common response headers, see Common parameters.

  • Response Body

    The response is in the XML format. A list of subscriptions is returned and each subscription includes a subscription URL. If the total number of subscriptions exceeds the value of the x-mns-ret-number parameter, the NextMarker parameter that indicates the start position of the next page is returned.

Examples

Sample requests

GET /topics/$TopicName/subscriptions HTTP/1.1
x-mns-ret-number:2
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
Date: Tue, 08 Dec 2015 06:16:18 GMT
Authorization: MNS 15B4D3461F177624206A:dXSLY5yGG8Ri5f26ZEmxMCq1CC4=
x-mns-version: 2015-06-06

Sample success responses

HTTP/1.1 200 OK
x-mns-request-id:566675B2B2B71C9C16000033
x-mns-version: 2015-06-06

<? xml version="1.0" encoding="utf-8"? >
<Subscriptions xmlns="http://mns.aliyuncs.com/doc/v1/">
    <Subscription>
        <SubscriptionURL>http://$AccountId.mns.cn-hangzhou.aliyuncs.com/$TopicName/subscriptions/$SubscriptionName1</SubscriptionURL>
    </Subscription>
    <Subscription>
        <SubscriptionURL>http://$AccountId.mns.cn-hangzhou.aliyuncs.com/$TopicName/subscriptions/$SubscriptionName2</SubscriptionURL>
    </Subscription>
    <NextMarker>OTczNjU4MTcvYmRwejd6NXluby8yNjg0Mi9+fn5FI1Rlc3RUb3BpYy0xI2JkcHo3ejV5bm8jVGVzdFN1Yi0zLzA=</NextMarker>
</Subscriptions>