Updated on 2024-04-16 GMT+08:00

Updating a Subscriber

Function

This API is used to update the subscriber remarks.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{project_id}/notifications/topics/{topic_urn}/subscriptions/{subscription_urn}

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.

topic_urn

Yes

String

Specifies the resource identifier of the topic, which is unique. To obtain the resource identifier, see Querying Topics.

subscription_urn

Yes

String

Specifies the resource identifier of the subscriber, which is unique. To obtain the resource identifier, see Query Subscriptions.

Request Parameters

Table 2 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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

remark

Yes

String

Specifies the subscriber remarks. The subscriber remarks can contain up to 128 bytes.

Minimum: 1

Maximum: 128

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique request ID.

subscription_urn

String

Specifies the resource identifier of a subscription, which is unique.

Status code: 400

Table 5 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 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: 404

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: 500

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.

Example Requests

Updating a subscriber

PUT https://{SMN_Endpoint}/v2/{project_id}/notifications/topics/urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1/subscriptions/urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1:2e778e84408e44058e6cbc6d3c377837

{
  "remark" : "test remark"
}

Example Responses

Status code: 200

OK

{
  "request_id" : "fdbabe38ead6482b8574f82a3d1168e9",
  "subscription_urn" : "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1:2e778e84408e44058e6cbc6d3c377837"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

403

Unauthorized

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.