• Simple Message Notification

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

Querying Topics

Description

  • API name

    ListTopics

  • Function

    Query the topic list by page. The list is sorted by the topic creation time in descending order. If no topic has been created, an empty list is returned.

URI

  • URI format

    GET /v2/{project_id}/notifications/topics?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. The default value is 100.

    The value ranges from 1 to 100.

Request

Request example
GET /v2/{project_id}/notifications/topics?offset=0&limit=100

Response

  • Parameter description

    Parameter

    Type

    Description

    request_id

    String

    Request ID, which is unique

    topic_count

    int

    Number of returned topics

    topics

    Topic structure array

    For details, see section Topic Structure.

  • Response example
    {
        "request_id": "70bb40bef50e4a14b116a5a527fd7432", 
        "topic_count": 1, 
        "topics": [
            {
                "topic_urn": "urn:smn:regionId:8bad8a40e0f7462f8c1676e3f93a8183:test_topic_v2", 
                "display_name": "testtest", 
                "name": "test_topic_v1", 
                "push_policy": 0            
            }
        ]
    }

Returned Value

See section Returned Value.

Error Code

See section Error Code.