Help Center/ Simple Message Notification/ API Reference/ APIs/ Topics/ Querying Sending Details of a Topic
Updated on 2025-06-24 GMT+08:00

Querying Sending Details of a Topic

Function

This API is used to query the data sent by a topic. You can query all metering data of the last 31 days.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/notifications/topics/{topic_urn}/statistics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.For details about how to obtain the project ID, see Obtaining the Project ID.

topic_urn

Yes

String

Unique resource identifier of a topic. To obtain the resource identifier, see Querying Topics.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

start_time

Yes

String

Start time.

end_time

Yes

String

End time.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies a user token.

It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Unique request ID.

total

SumCountDetail object

Total number of sent messages in a period.

statistics

Array of StatisticsDetail objects

List of sending details in a period.

Table 5 SumCountDetail

Parameter

Type

Description

sms

Integer

Number of sent messages.

Table 6 StatisticsDetail

Parameter

Type

Description

count

CountDetail object

Sending details in a period.

start_time

String

Start time.

Table 7 CountDetail

Parameter

Type

Description

sms

Integer

Number of sent SMS messages.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique ID of a request.

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique ID of a request.

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique ID of a request.

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Example Requests

Querying sending details of a topic

GET https://{SMN_Endpoint}/v2/{project_id}/notifications/topics/urn:smn:regionId:8bad8a40e0f7462f8c1676e3f93a8183:test_topic/statistics?start_time="2025-02-17T16:00:00Z"&end_time='2025-02-19T15:59:59Z'

Example Responses

Status code: 200

OK

{
  "request_id" : "stringxxxxxxxxxxxxxxx",
  "total" : {
    "sms" : 123
  },
  "statistics" : [ {
    "count" : {
      "sms" : 123
    },
    "start_time" : "2025-02-17T16:00:00Z"
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

403

Unauthorized

500

Internal Server Error

Error Codes

See Error Codes.