CreateTopic
Create a topic. Each user can create 3000 topics at most. In the high-concurrent scenario, a user may create a few topics more than 3000.
The API is idempotent. It returns a successful result after creating a topic. If a topic of the same name already exists, the status code is 200. Otherwise, the status code is 201.
POST /v2/{project_id}/notifications/topics
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
name |
Yes |
String |
Name of the topic to be created The topic name is a string of 1 to 255 characters. It must contain letters, digits, hyphens (-), and underscores (_), and must start with a letter or digit. |
display_name |
No |
String |
Topic display name, which is presented as the name of the email sender in email messages The display name cannot exceed 192 bytes. The value is left blank by default. |
POST https://{SMN_Endpoint}/v2/{project_id}/notifications/topics
{
"name": "test_topic_v2",
"display_name": "testtest"
}
Parameter |
Type |
Description |
|---|---|---|
request_id |
String |
Request ID, which is unique |
topic_urn |
String |
Unique resource ID of a topic. You can obtain it based on Querying Topics. |
{
"request_id": "6a63a18b8bab40ffb71ebd9cb80d0085",
"topic_urn": "urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2"
}
See Returned Value.
See Error Code.