All Products
Search
Document Center

IoT Platform:UpdateProductTopic

Last Updated:Nov 29, 2023

Modifies a custom topic category.

QPS limits

You can call this API operation up to 50 times per second per account.

Note The RAM users of an Alibaba Cloud account share the quota of the account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes UpdateProductTopic

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

Operation String Yes PUB

The permissions of the device on the topic category. Valid values:

  • SUB: Subscribe.
  • PUB: publish
  • ALL: publish and subscribe
TopicId String Yes 821****

The ID of the topic category that you want to modify.

If a custom topic category is created after you call the CreateProductTopic operation, the topic category ID indicated by TopicId is returned.

TopicShortName String Yes resubmit

The name of the custom category level. By default, a topic category includes the following levels: _productkey_ and _devicename_. Separate the two levels with slashes (/). Format of a topic category: productKey/deviceName/topicShortName.

Note Each level can contain letters, digits, and underscores (_), and cannot be left empty.
IotInstanceId String Optional iot_instc_pu****_c*-v64********

The ID of the instance. You can obtain the ID of the instance on the Overview tab in the IoT Platform console.

Important
  • If your instance has an ID, you must specify the ID for this parameter. Otherwise, the call fails.
  • If your instance does not have an ID, you do not need to configure the parameter.

For more information about instances, see Overview.

Desc String No resubmit a test topic

The description of the topic category. The description must be 1 to 100 characters in length.

EnableProxySubscribe Boolean No false

If you set Operation to SUB or ALL, you can enable the delegated subscription feature.

Valid values:

  • true: enables the delegated subscription feature.
  • false: disables the delegated subscription feature.

If you enable the delegated subscription feature for a topic, IoT Platform obtains the details of the topic and helps a device subscribe to the topic when you connect the device to IoT Platform.

Codec String No compress

Specifies whether to enable the data compression or decompression feature for a custom topic. This parameter is available only if you use a Standard or Exclusive Enterprise Edition instance.

Valid values:

  • compress: enables data compression.
  • decompress: enables data decompression.

For more information, see Data compression.

Important If you specify a value that includes wildcard characters (+and #) for TopicShortName, you cannot configure Codec. If the data compression or decompression feature is enabled when you use the wildcard characters to create a topic category, this request fails.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information about common request parameters, see Common parameters.

Response parameters

Parameter

Type

Example

Description

Code String iot.system.SystemException

The error code returned if the call fails. For more information, see Error codes.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

RequestId String FCC27691-9151-4B93-9622-9C90F30542EC

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=UpdateProductTopic
&TopicId=821****
&TopicShortName=resubmit
&Operation=PUB
&Desc=resubmit a test topic
&<Common request parameters>

Sample success responses

XML format

<UpdateProductTopicResponse>
      <RequestId>FCC27691-9151-4B93-9622-9C90F30542EC</RequestId>
      <Success>true</Success>
</UpdateProductTopicResponse>

JSON format

{
    "RequestId":"FCC27691-9151-4B93-9622-9C90F30542EC",
    "Success":true
}

Error codes

For a list of error codes, see Service error codes.