You can call the OnsTopicList API to query the information list of all topics under an account.

This operation is used to generate a resource list without viewing specific information.


You can directly run this interface in OpenAPI Explorer, saving you from the trouble of calculating the signature. After the SDK runs successfully, OpenAPI Explorer automatically generates SDK code examples.

Request parameters

Name Type Required or not Sample value Description
Action String Yes OnsTopicList

The operation that you want to perform. Set the value to OnsTopicList.

InstanceId String No Mq_inst_1111111111_doxxxxxx

The instance ID corresponding to the Topic information list to be obtained. This parameter is required for instances with independent namespaces.

Topic String No Test

This parameter is set when you query the specified Topic. Otherwise, all topics are queried.

Response Data

Name Type Sample value Description

The list of all published topics.


The list of all published topics.

CreateTime Long 1570700947000

Created at

IndependentNaming Boolean True

Indicates whether the instance of the Topic has a namespace. Valid values:

  • True: Has an independent namespace. The resource name must be unique within the instance and can be repeated across instances.
  • False: There is no separate namespace. The resource name must be globally unique within an instance or across instances.
InstanceId String Mq_inst_1111111111_doxxxxxx

The ID of the instance to which the Topic belongs.

MessageType Integer 0

The message type. Valid values:

  • 0: Normal message
  • 1: Partitionally ordered message
  • 2: Globally ordered message
  • 4: Transactional Message
  • 5: Scheduled/delayed message
Owner String 138015630679 *****

The ID of the Topic owner, which is the Alibaba Cloud UID.

Relation Integer 6

All relation IDs. Valid values:

  • 1Owner
  • 2: Publish
  • 4: Subscription is allowed.
  • 6: Publish and subscribe.
RelationName String Authorized publishing/subscription

All relation names, such as owner, subscribable, publishable, as well as subscribable and publishable

Remark String Test


Topic String Test

Topic Name

RequestId String Renewal

A common parameter. Each request is unique.


Request example

http(s)://[Endpoint]/? Action=OnsTopicList
& <Common request parameters>

Normal response example


              <RelationName> authorized publishing/subscription </RelationName>
              <Remark> Test </Remark>


				&quot;RelationName&quot;: &quot;authorized publishing/subscription&quot;,
				&quot;Remark&quot;: &quot;test&quot;,

Error code