• Simple Message Notification

smn
  1. Help Center
  2. Simple Message Notification
  3. API Reference
  4. APIs
  5. Subscription Operations
  6. Querying Subscriptions

Querying Subscriptions

Description

  • API name

    ListSubscriptions

  • Function

    Query the list of all subscriptions by page. The list is sorted by the subscription adding time in ascending order. If no subscription has been added, an empty list is returned.

URI

  • URI format

    GET /v2/{project_id}/notifications/subscriptions?offset=0&limit=2

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    offset

    No

    int

    Starting page of the list, which is 0 by default

    The value must be greater than or equal to 0.

    limit

    No

    int

    Maximum number of items returned at a time, which is 100 by default

    The value ranges from 1 to 100.

Request

Request example
GET /v2/{project_id}/notifications/subscriptions?offset=0&limit=2

Response

  • Parameter description

    Parameter

    Type

    Description

    request_id

    String

    Request ID, which is unique

    subscription_count

    int

    Number of subscriptions

    subscriptions

    Subscription structure array

    See section Subscription Structure.

  • Response example
    {
        "request_id": "4650b14bf221492fb819c231d167e6fe", 
        "subscription_count": 2, 
        "subscriptions": [
            {
                "topic_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1", 
                "protocol": "sms", 
                "subscription_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1:2e778e84408e44058e6cbc6d3c377837", 
                "owner": "762bdb3251034f268af0e395c53ea09b", 
                "endpoint": "xxxxxxxxxxx", 
                "remark": "", 
                "status": 0
            }, 
            {
                "topic_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1", 
                "protocol": "email", 
                "subscription_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1:a2d52a9f5c3b47f48c3fafb177a58796", 
                "owner": "762bdb3251034f268af0e395c53ea09b", 
                "endpoint": "xx@xx.com", 
                "remark": "", 
                "status": 0
            }
    ] 
    }

Returned Value

See section Returned Value.

Error Code

See section Error Code.