Call this operation to send a request to a specified device and receive a response from the device synchronously.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to RRpc.
ProductKey String Yes The product key of the device that will receive the request.
DeviceName String Yes The name of the device that will receive the request.
RequestBase64Byte String Yes The request message string, which is generated by encoding your request message using the Base64 encoding scheme.
Timeout Integer Yes The time period for the device to respond to the request. The value is in milliseconds, and the value range is from 1,000 to 5,000.
Topic  String  No The custom RRPC request topic. For information about defining RRPC message topics, see Define topics.

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

Common request parameters - Yes See Common parameters.

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.
MessageId String The message ID automatically generated after a request is sent successfully. The message ID is used to identify the request message.
RrpcCode String

The status code returned when the call is successful. The status code is used to identify the request status. Options:

UNKNOW: A system exception occurred.

SUCCESS: The operation is successful.

TIMEOUT: The device has not responded within the specified timeout time.

OFFLINE: The device is offline.

HALFCONN: The device is offline. In this status, the device is offline but it has not been offline for a full heartbeat cycle.

PayloadBase64Byte String The Base64-encoded payload returned by the device.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=RRpc
&ProductKey=al*******
&DeviceName=device1
&RequestBase64Byte=aGVsbG8gd29ybGQ%3D
&TimeOut=1000
&Common request parameters

Response example

  • JSON format

    {
          "RequestId":"41C4265E-F05D-4E2E-AB09-E031F501AF7F",
          "Success":true,
          "RrpcCode":"SUCCESS",
          "PayloadBase64Byte":"d29ybGQgaGVsbG8="
          "MessageId":889455942124347392
      }
  • 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>