Mengambil detail kategori topik kustom suatu Produk.
Batas QPS
Anda dapat memanggil operasi API ini hingga tiga kali per detik per akun.
Debugging
Parameter permintaan
|
Parameter |
Type |
Required |
Example |
Description |
| Action | String | Yes | QueryProductTopic | Operasi yang ingin Anda lakukan. Tetapkan nilainya ke QueryProductTopic. |
| ProductKey | String | Yes | HMyB******* | ProductKey dari Produk tersebut. |
| IotInstanceId | String | No | iot_instc_pu****_c*-v64******** | ID instans. Anda dapat memperoleh ID instans pada halaman Overview di Konsol IoT Platform. Penting
Untuk informasi selengkapnya, lihat Instance overview. |
Selain parameter permintaan khusus operasi di atas, Anda harus menentukan parameter permintaan umum saat memanggil operasi ini. Untuk informasi selengkapnya, lihat Common parameters.
Parameter respons
Parameter |
Type |
Example |
Description |
| Code | String | iot.system.SystemException | Kode kesalahan yang dikembalikan jika pemanggilan gagal. Untuk informasi selengkapnya, lihat Error codes. |
| Data | Array of ProductTopicInfo | Kategori topik kustom yang dikembalikan jika pemanggilan berhasil. Untuk informasi selengkapnya, lihat ProductTopicInfo. |
|
| ProductTopicInfo | |||
| Codec | String | compress | Menunjukkan apakah fitur kompresi atau dekompresi data diaktifkan untuk kategori topik kustom. Nilai yang valid:
Untuk informasi selengkapnya, lihat Data compression. |
| Desc | String | topicDesc | Deskripsi kategori topik kustom. |
| EnableProxySubscribe | Boolean | false | Menunjukkan apakah fitur subscription delegasi diaktifkan. Nilai yang valid:
Jika Anda mengaktifkan fitur subscription delegasi untuk suatu topik, IoT Platform akan mengambil detail topik tersebut dan membantu Perangkat berlangganan ke topik tersebut saat Anda menghubungkan Perangkat ke IoT Platform. |
| Id | String | 821**** | ID kategori topik kustom. |
| Operation | String | 1 | Izin yang ingin Anda berikan kepada Perangkat pada kategori topik kustom. Nilai yang valid:
|
| ProductKey | String | HMyB*** | ProductKey dari Produk tersebut. |
| TopicShortName | String | /HMyB***/${deviceName}/user/get | Nama kategori topik kustom. |
| ErrorMessage | String | A system exception occurred. | Pesan kesalahan yang dikembalikan jika pemanggilan gagal. |
| RequestId | String | B953EAFF-CFF6-4FF8-BC94-8B89F018E4DD | ID permintaan. |
| Success | Boolean | true | Menunjukkan apakah pemanggilan berhasil. Nilai yang valid:
|
Contoh
Contoh permintaan
https://iot.cn-shanghai.aliyuncs.com/?Action=QueryProductTopic
&ProductKey=HMyB*******
&<Common request parameters>
Contoh respons sukses
XML format
<QueryProductTopicResponse>
<RequestId>310E4A1E-B614-5607-B7DB-55530CAE074A</RequestId>
<Data>
<ProductTopicInfo>
<TopicShortName>/g18******F/${deviceName}/user/get</TopicShortName>
<EnableProxySubscribe>false</EnableProxySubscribe>
<Operation>1</Operation>
<Id>3679****</Id>
<ProductKey>g18******F</ProductKey>
</ProductTopicInfo>
<ProductTopicInfo>
<TopicShortName>/g18******F/${deviceName}/user/update</TopicShortName>
<EnableProxySubscribe>false</EnableProxySubscribe>
<Operation>0</Operation>
<Id>3679****</Id>
<ProductKey>g18******F</ProductKey>
</ProductTopicInfo>
<ProductTopicInfo>
<TopicShortName>/g18******F/${deviceName}/user/update/error</TopicShortName>
<EnableProxySubscribe>false</EnableProxySubscribe>
<Operation>0</Operation>
<Id>3679****</Id>
<ProductKey>g18******F</ProductKey>
</ProductTopicInfo>
</Data>
<Success>true</Success>
</QueryProductTopicResponse>
JSON format
{
"RequestId": "310E4A1E-B614-5607-B7DB-55530CAE074A",
"Data": {
"ProductTopicInfo": [
{
"TopicShortName": "/g18******F/${deviceName}/user/get",
"EnableProxySubscribe": false,
"Operation": "1",
"Id": "3679****",
"ProductKey": "g18******F"
},
{
"TopicShortName": "/g18******F/${deviceName}/user/update",
"EnableProxySubscribe": false,
"Operation": "0",
"Id": "3679****",
"ProductKey": "g18******F"
},
{
"TopicShortName": "/g18******F/${deviceName}/user/update/error",
"EnableProxySubscribe": false,
"Operation": "0",
"Id": "3679****",
"ProductKey": "g18******F"
}
]
},
"Success": true
}
Kode kesalahan
Untuk daftar kode kesalahan, lihat Service error codes.