Creating a Topic
Description
- Function
Create a topic. Each user can create 3,000 topics at most. In the high-concurrent scenario, a user may create a few topics more than 3,000.
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.
URI
- Parameter description
Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID
Request
- Parameter description
Parameter
Mandatory
Type
Description
name
Yes
String
Name of the topic
Enter 1 to 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The topic name must start with a letter or digit.
display_name
Yes
String
Topic display name, which is presented as the name of the email sender in email messages
The display name cannot exceed 192 bytes.
display_name is left blank by default.
enterprise_project_id
No
String
(Optional) Enterprise project ID. It is required when the enterprise project function is enabled.
Default value: 0
- Example request
POST https://{SMN_Endpoint}/v2/{project_id}/notifications/topics
{ "name": "test_topic_v2", "display_name": "testtest" }
Response
- Parameter description
Parameter
Type
Description
request_id
String
Request ID, which is unique
topic_urn
String
Unique resource ID of a topic. You can obtain it by referring to Querying Topics.
- Example response
{ "request_id": "6a63a18b8bab40ffb71ebd9cb80d0085", "topic_urn": "urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2" }
Returned Value
See Returned Value.
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot