Deleting Topics

Last updated: 2019-07-05 15:07:00


1. API Description

This API (DeleteTopic) is used to delete a created topic.

Domain for public network API request:

Domain for private network API request:

Whenever (including during alpha test) any public network downstream traffic is generated from the use of a public network domain, a fee will be charged. It is strongly recommended that users whose services are on the Tencent Cloud use private network domains, because no fee will be charged for the traffic consumed in the private network.

  • region should be replaced with a specific region: gz (Guangzhou), sh (Shanghai), or bj (Beijing). The region value in the common parameters should be consistent with the region value of the domain. If there is an inconsistency, the request will be sent to the region specified by the domain.
  • Public network domain requests both support http and https. Private network requests only support http.
  • Some of the input parameters are optional. If not specified, the default value will be taken.
  • All the output parameters will be returned to the user when the request is successful; otherwise, at least code, message, and requestId will be returned.

2. Input Parameters

The following request parameter list only provides API request parameters. For other parameters, refer to Common Request Parameters.

Parameter Name Required Type Description
topicName Yes String Topic name. It is unique under the same account in one region. The topic name is a string of no more than 64 characters, which can contain letters, numbers, and hyphens (-) and must begin with a letter.

3. Output Parameters

Parameter Name Type Description
code Int 0: Succeeded, others: Error. See the table below for specific errors.
message String Error message.
requestId String ID of the request generated by server. When there is an internal error on the server, users can submit this ID to the backend to locate the problem.
Error Code Module Error Code Error Message Description
4000 10540 there exists subscriptions under this topic, please unsubscribe all of them before DeleteTopic Before deleting a topic, you must ensure that there are no subscriptions under this topic. This is to prevent mistaken deletions.

Note: The error codes listed in the above table are specific to this API. If the error code you are looking for is not in the table, you may find it in the Common Error Codes.

4. Example


 &<Common request parameters>


"code" : 0,
"message" : "",