All Products
Search
Document Center

Common parameters

Last Updated: May 25, 2022

This topic describes the common request parameters and common response parameters of the IoT Platform API.

Common request parameters

Common request parameters must be included in all IoT Platform API requests.

Parameter

Type

Required

Description

Format

String

No

The format in which to return the response. Valid values: JSON and XML. Default value: XML.

Version

String

Yes

The version number of the API. The value must be in the YYYY-MM-DD format. The latest version is 2018-01-20. Each API has multiple versions.

AccessKeyId

String

Yes

The AccessKey ID provided to you by Alibaba Cloud.

To create or view an AccessKey pair, perform the following steps: Log on to the Alibaba Cloud Management Console, move the pointer over the profile picture, and then click AccessKey Management. On the AccessKey Pair page, view or create an AccessKey pair.

Signature

String

Yes

The signature string of the current request. For more information about how signatures are calculated, see Signature method.

SignatureMethod

String

Yes

The encryption method of the signature string. Set the value to HMAC-SHA1.

Timestamp

String

Yes

The timestamp of the request. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.

For example, you can set this parameter to 2016-01-04T12:00:00Z, which indicates January 4, 2016 20:00:00 UTC+8.

SignatureVersion

String

Yes

The version of the signature encryption algorithm. Set the value to 1.0.

SignatureNonce

String

Yes

A unique, random number used to prevent replay attacks. You must use different numbers for different requests.

RegionId

String

Yes

The ID of the region where your devices reside. The region must be the same as the region that you specified in the IoT Platform console. Example: cn-shanghai.

Example

https://iot.cn-shanghai.aliyuncs.com/
?Format=XML
&Version=2018-01-20
&Signature=Pc5WB***
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=234***
&Timestamp=2018-05-20T12:00:00Z
&RegionId=cn-shanghai

Common response parameters

API responses use the HTTP response format where a 2xx status code indicates a successful call and a 4xx or 5xx status code indicates a failed call. Responses can be returned in either the JSON or XML format. You can specify the response format in the request. The default response format is XML.

Each response includes a unique request ID that is indicated by the RequestId parameter regardless of whether the call is successful.

  • Sample success responses

    • XML format

      <?xml version="1.0" encoding="UTF-8"?> 
      <!--Result Root Node-->
      <API operation name+Response>
          <!--Return Request Tag-->
          <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
          <!--Return Result Data-->
      </API operation name+Response>
    • JSON format

      {
          "RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
          /* Return results */
      }
  • Sample error responses

    If an error occurs when you call an API operation, no result data is returned. You can use the error code to identify the failure cause.

    If an error occurs when you call an API operation, a 4XX or 5XX HTTP status code is returned. The returned message contains the specific error code and message. The returned message also contains a globally unique request ID that is returned in the RequestId parameter. If you cannot confirm what error occurs, contact Alibaba Cloud customer service or submit a ticket. You must provide your request ID for assistance.

    • XML format

      <?xml version="1.0" encoding="UTF-8"?>
      <Error>
         <RequestId>8906582E-6722-409A-A6C4-0E7863B733A5</RequestId>
         <Code>UnsupportedOperation</Code>
         <Message>The specified action is not supported.</Message>
      </Error>
    • JSON format

      {
          "RequestId": "8906582E-6722-409A-A6C4-0E7863B733A5",
          "Code": "UnsupportedOperation",
          "Message": "The specified action is not supported."
      }