Updated on 2025-08-21 GMT+08:00

Querying SMN Topics

Function

This API is used to query the SMN topics of a user. You can obtain their key information, such as topic names, IDs, and the quantity, helping you learn about the message push channels and statuses.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/lts/notifications/topics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. It can be obtained by calling an API or from the console. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Definition

Offset of the SMN topic list. The initial value is 0. For all subsequent requests, use the offset value provided in the previous API response.

Constraints

N/A

Range

N/A

Default Value

N/A

limit

Yes

Integer

Definition

Maximum number of results that can be returned in a single query of the SMN topic list.

Constraints

N/A

Range

  • Minimum value: 1

  • Maximum value: 100

Default Value

10

fuzzy_name

No

String

Definition

Name of the topic to be searched for. Fuzzy match is performed based on the prefix match mode.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. For details about how to obtain it, see Obtaining a User Token.

Constraints:

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Message body format. Set this parameter to application/json;charset=utf8.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Definition

Unique ID of the request.

Range

N/A

topic_count

Integer

Definition

Total number of SMN topic information records.

Range

N/A

topics

Array of Topics objects

Definition

SMN topic information.

Table 5 Topics

Parameter

Type

Description

name

String

Definition

SMN topic name.

Range

N/A

topic_urn

String

Definition

Unique resource ID of the SMN topic.

Range

N/A

display_name

String

Definition

Sender name displayed in an email.

Range

N/A

push_policy

Integer

Definition

Message push policy. Currently, this attribute is not modifiable. Support for modifying this setting will be added in a future update.

Range

  • 0: Failed messages will be retained in the failure queue.

  • 1: Failed messages will be discarded.

Example Requests

Query SMN topics.

GET https://{endpoint}/v2/{project_id}/lts/notifications/topics

/v2/{project_id}/lts/notifications/topics?offset={offset}&limit={limit} 

Example Responses

Status code: 200

The request is successful.

{
  "request_id" : "1",
  "topic_count" : 100,
  "topics" : [ {
    "name" : "huawei",
    "topic_urn" : "urn:smn:cn-north-7:{projectId}:fyy",
    "display_name" : "",
    "push_policy" : 0
  } ]
}

Status Codes

Status Code

Description

200

The request is successful.

Error Codes

See Error Codes.