Help Center/ Simple Message Notification/ API Reference/ Out-of-Date APIs/ Application Endpoints/ Querying the Endpoints of an Application (Deprecated)
Updated on 2022-12-12 GMT+08:00

Querying the Endpoints of an Application (Deprecated)

Function

This API is used to query the endpoints of an application.

URI

GET /v2/{project_id}/notifications/applications/{application_urn}/endpoints

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

application_urn

Yes

String

Specifies the unique resource identifier of the application. To obtain it, see Querying an Application.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Specifies the offset.

If the offset is an integer greater than 0 but less than the number of resources, all resources in excess of this offset will be queried. The default offset is 0.

Default: 0

limit

No

Integer

Specifies the maximum number of records in each query.

The number ranges from 1 to 100 and is generally 10, 20, or 50. Specifies the number of resources returned on each page. The default number is 100.

Default: 100

enabled

No

String

Specifies whether a device is enabled. The value is a string and can be true or false.

token

No

String

Specifies the device token, which contains a maximum of 512 bytes.

user_data

No

String

Specifies the description or additional information about the endpoint. The value cannot exceed 2,048 bytes.

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

Specifies the request ID, which is unique.

next_page_flag

Boolean

Specifies whether a link to the next page is provided.

endpoints

Array of ApplicationEndpoint objects

Specifies the Application_endpoint structure array.

Table 5 ApplicationEndpoint

Parameter

Type

Description

create_time

String

Specifies the time when the application was created. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.

endpoint_urn

String

Specifies the unique resource ID of an application endpoint.

user_data

String

Specifies the description or additional information about the endpoint. The value is a UTF-8 encoded string not exceeding 2,048 bytes.

enabled

String

Specifies whether the endpoint is enabled. The value is a string and can be true or false.

token

String

Specifies the device token, which contains a maximum of 512 bytes.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID, which is unique.

code

String

Specifies the error code.

message

String

Describes the error message.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID, which is unique.

code

String

Specifies the error code.

message

String

Describes the error message.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID, which is unique.

code

String

Specifies the error code.

message

String

Describes the error message.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID, which is unique.

code

String

Specifies the error code.

message

String

Describes the error message.

Example Requests

GET https://{SMN_Endpoint}/v2/{project_id}/notifications/applications/{application_urn}/endpoints?offset=0&limit=10

null

Example Responses

Status code: 200

OK

{
  "request_id" : "c90d871f77f7425cae0a8b772a563d17",
  "next_page_flag" : false,
  "endpoints" : [ {
    "create_time" : "2018-01-12T01:25:14Z",
    "endpoint_urn" : "urn:smn:regionId:429ffced18074da0938112f2c362b935:endpoint-APNS-application_name-62f0bafec61c45fbbb5d0fc6bd696a2d",
    "user_data" : "no user data",
    "enabled" : "true",
    "token" : "1f2fda4c1013c47ac4c59bd22379d88e14b07b0ebf47f2f79d1a6b06ed03390d"
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

403

Unauthorized

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.