Getting Topic List

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

1. API Description

This API (ListTopic) is used to display the topic list under a user's account, and the list can be obtained by page.

Domain for public network API request: cmq-topic-region.api.qcloud.com

Domain for private network API request: cmq-topic-region.api.tencentyun.com

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
searchWord No String It is used to filter topic lists. The backend will return topic lists which meet the conditions through fuzzy match. If this parameter is not specified, all the topics under the account will be returned by default.
offset No Int The starting position from which the current page get the queue list when paging query is performed. If this value is specified, the "limit" is also required. By default, the backend will take the value as 0
limit No Int Number of topics obtained in this page when paging query is performed. If the parameter is not passed, the default value of 20 will be taken.

The meanings of offset and limit here are the same as the offset and limit of SQL.

3. Output Parameters

Parameter Name Type Description
code Int Please refer to Error Codes
message String Error message.
requestId String Request ID generated by server. When there is an internal error on the server, users can submit this ID to the backend to locate the problem.
totalCount Int It indicates the total number of topics returned under the user account for this request, not the number of topics acquired in this page after paging query is performed.
topicList Array Topic list information. Each element indicates the information of one topic.

topicList is defined as follows:

Parameter Name Type Description
topicId String Unique ID of a topic.
topicName 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.

4. Example

Input:

 https://domain/v2/index.php?Action=ListTopic
 &searchWord=test
 &<Common request parameters>

Output:

{
"code" : 0,
"message" : "",
"requestId":"14534664555",
"totalCount":10
"topicList":
[
{
"topicId":"topic-asdfo",
"topicName":"test-topic1"
}
,
{
"topicId":"topic-asdsafo",
"topicName":"topic-test1"
}
]
}