Creates a task to distribute a product to a specified instance.

Usage notes

  • This operation can be called only by using the following endpoint: iot.cn-shanghai.aliyuncs.com.
  • You cannot call this operation to distribute a product across accounts.
  • A product distribution task does not distribute the devices under the product.
  • After a product is distributed, you cannot modify its TSL model and scripts.
  • Each Alibaba Cloud account can create a maximum of 10 tasks to distribute products or devices. For more information about how to create a device distribution task, see CreateDeviceDistributeJob.
  • Each Alibaba Cloud account can run a maximum of 2 queries per second (QPS).
    Note 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 CreateProductDistributeJob

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

ProductKey String Yes a1BwAGV****

The ProductKey of the product to be published.

SourceInstanceId String Yes iot-cn-st2***

The ID of the source instance to which the product belongs.

  • The IDs of public instances in different regions:
    • China (Shanghai): iotx-oxssharez200.
    • Japan (Tokyo): iotx-oxssharez300.
    • Singapore (Singapore): iotx-oxssharez400.
    • US (Silicon Valley): iotx-oxssharez500.
    • US (Virginia): iotx-oxssharez600.
    • Germany (Frankfurt): iotx-oxssharez700.
  • The IDs of Enterprise Edition instances:

    1. Log on to the IoT Platform console. Select a region from the drop-down list in the upper-left corner of the top navigation bar.

    2. On the Overview page, click the instance name. On the Instance Details page, view the instance ID in the Basic Information section.

TargetInstanceId String Yes iot-cn-6ja***

The ID of the destination instance to which the product is distributed. For more information about instance IDs, see the description of the SourceInstanceId parameter.

TargetUid String No 198***

The ID of the Alibaba Cloud account to which the product belongs. You can log on to the IoT Platform console, click the profile picture, and then view Account ID on the Security Settings page.

The TargetUid and TargetAliyunId parameters cannot be left empty at the same time.

TargetAliyunId String No io****@example.com

The Alibaba Cloud account to which the product belongs. You can log on to the IoT Platform console, click the profile picture, and then view Logon Account on the Security Settings page.

The TargetUid and TargetAliyunId parameters cannot be left empty at the same time.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information, see Common request 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.

JobId String UbmsMHmkqv0PiAG****010001

The task ID returned if the call is successful. The ID globally identifies the task.

RequestId String E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

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

Examples

Sample requests

http(s)://iot.cn-shanghai.aliyuncs.com/?Action=CreateProductDistributeJob
&ProductKey=a1BwAGV****
&SourceInstanceId=iot-cn-st2***
&TargetInstanceId=iot-cn-6ja***
&TargetAliyunId=io****@example.com
&<Common request parameters>

Sample success responses

XML format

<CreateProductDistributeJobResponse>
  <RequestId>E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565</RequestId>
  <JobId>UbmsMHmkqv0PiAG****010001</JobId>
  <Success>true</Success>
</CreateProductDistributeJobResponse>

JSON format

{
    "RequestId": "E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565",
    "JobId": "UbmsMHmkqv0PiAG****010001",
    "Success": true
}