Sends a request to a specified device and synchronously receives a response from the device.

Usage notes

If the device fails to send a response within the timeout period after you call the operation, IoT Platform considers that the call fails even if the device receives the message. The timeout period is specified by the Timeout parameter.

QPS limits

Each Alibaba Cloud account can run up to 1000 queries per second (QPS).

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 RRpc

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

DeviceName String Yes device1

The name of the device that receives the request.

ProductKey String Yes aldfeSe****

The ProductKey of the product to which the device belongs.

RequestBase64Byte String Yes dGhpcyBpcyBhbiBleGFtcGxl

The string that is obtained by performing Base64 encoding on the message. Example: dGhpcyBpcyBhbiBleGFtcGxl.

Timeout Integer Yes 1000

The timeout period of a response. Unit: milliseconds. Valid values: 1000 to 8000.

IotInstanceId String No iot_instc_pu****_c*-v64********

The ID of the instance. You can view the instance ID on the Overview page in the IoT Platform console.

Notice
  • If your instance has an ID, you must configure this parameter. If you do not set this parameter, the call fails.
  • If your instance has no Overview page or ID, you do not need to set this parameter.

For more information, see Overview.

Topic String No /a1uZfYb****/A_Vol****/user/update

The custom revert-RPC (RRPC) topic. Before you can use a custom RRPC topic, you must configure the device. For more information, see Use custom topics.

If you do not configure this parameter, the default RRPC topic is used.

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.

MessageId Long 889455942124347392

The ID of the request. The request ID is generated by IoT Platform after the request is sent.

PayloadBase64Byte String d29ybGQgaGVsbG8=

The Base64 encoded payload that is returned by the device.

RequestId String 41C4265E-F05D-4E2E-AB09-E031F501AF7F

The ID of the request.

RrpcCode String SUCCESS

The response code returned if the call is successful. Valid values:

  • UNKNOWN: A system error occurred.
  • SUCCESS: The request is successful.
  • TIMEOUT: The request times out.
  • OFFLINE: The device is offline.
  • HALFCONN: The device is offline. If the status of the device is HALFCONN, the device is offline but does not remain offline for a full heartbeat cycle.
Success Boolean true

Indicates whether the call was successful.

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

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=RRpc
&ProductKey=aldfeSe****
&DeviceName=device1
&RequestBase64Byte=dGhpcyBpcyBhbiBleGFtcGxl
&Timeout=1000
&<Common request parameters>

Sample success responses

XML format

<?xml version='1.0' encoding='UTF-8'?>
  <RRpcResponse>
      <RequestId>41C4265E-F05D-4E2E-AB09-E031F501AF7F<RequestId/>
      <Success>true</Success>
      <RrpcCode>SUCCESS</RrpcCode>
      <PayloadBase64Byte>d29ybGQgaGVsbG8=</PayloadBase64Byte>
      <MessageId>889455942124347392</MessageId>
  </RRpcResponse>

JSON format

{
      "RrpcCode":"SUCCESS",
      "PayloadBase64Byte":"d29ybGQgaGVsbG8=",
      "MessageId":889455942124347392,
      "RequestId":"41C4265E-F05D-4E2E-AB09-E031F501AF7F",
      "Success":true
}