Call this operation to run a service on multiple devices.

Limits

  • The maximum number of requests per second for a tenant is 10 QPS.
  • Currently, only asynchronous calls to the API are supported.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to InvokeThingService.
ProductKey String Yes

The ProductKey of the specified devices.

DeviceNames List<String> Yes

The names of the devices on which you want to run the service. Supports up to 100 devices.

Identifier String Yes The identifier of the service.

To view the service identifier of the devices, go to the Define Feature page of the product that the devices belong to in the console.

Args String Yes

Specify input parameter values of the service. The value of this parameter is a JSON string. Example: Args={"param1": 1}.

If you do not want to specify any input parameter, pass in this parameter as Args={}.

For more information about arguments, see the following table Args.

Common request parameters - Yes See Common parameters.
Table 1. Args
Parameter Type Description
key String

The input parameter identifier that you set when you created the service.

You can find the identifier in the Thing Specification Language (TSL) on the Define Feature page of the product in the console. Alternatively, you can click Edit corresponding to the service, and view the input parameters that you have specified.

value Object The value of the parameter. The value must be within the valid range you have set.

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.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/&Action=InvokeThingsService
&Args=%7B%20%20%20%20%20%22walk%22%3A%22a~z%22%2C%20%20%20%20%20%22city%22%3A%22shanghai%22%20%7D
&DeviceName. 1=1102andriod02
&DeviceName. 2=1102android01
&Identifier=TimeReset
&ProductKey=a1hWjHDWUbF
&Common request parameters

Response example

JSON format

{
  "RequestId": "059C3274-6197-4BEC-95E4-49A076330E57",
  "Success": true
}

XML format

<? xml version='1.0' encoding='utf-8'? >
<InvokeThingsServiceResponse>
    <RequestId>"059C3274-6197-4BEC-95E4-49A076330E57</RequestId>
    <Success>true</Success>
</InvokeThingsServiceResponse>