Call this operation to query the topic categories of a specified product.

Request Parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to QueryProductTopic.
ProductKey String Yes The key of the product whose topic categories you want to query.
Common Request Parameters - Yes See Common parameters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID generated by Alibaba Cloud for the request.
Success Boolean Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.
ErrorMessage String The error message returned when the call fails.
Code String The error code returned when the call fails. For more information about error codes, see Error codes.
Data ProductTopicInfo The list of topic categories returned when the call is successful. For more information, see ProductTopicInfo.
Table 1. ProductTopicInfo
Parameter Type Description
ProductKey String The product key, which is the unique identifier of the product
Id String The ID of the topic category.
TopicShortName String The topic category name except for the topic hierarchies of productKey and ${deviceName}.
Operation String

The operation that devices of the product can perform on this topic category. Values include:

0: Publish. Devices can publish messages using the topics of this category.

1: Subscribe. Devices can subscribe to the topics of this category.

2: Publish and subscribe. Devices can publish messages to and subscribe to the topics of this category.

Desc String The description of the topic category.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryProductTopic
&ProductKey=HMyB*******
&Public Request Parameters

Response example

{
    "Data": [{
        "Id": "10000",
        "Operation": "0",
        "ProductKey": "HMyB***",
        "TopicShortName": "/HMyB***/${deviceName}/update"
    },
    {
        "Id": "10001",
        "Operation": "2",
        "ProductKey": "HMyB***",
        "TopicShortName": "/HMyB***/${deviceName}/update/error"
    },
    {
        "Id": "10002",
        "Operation": "1",
        "ProductKey": "HMyB***",
        "TopicShortName": "/HMyB***/${deviceName}/get"
    }],
    "RequestId": "B953EAFF-CFF6-4FF8-BC94-8B89F018E4DD",
    "Success": true
}