Common parameters
This document describes the common request parameters and common response parameters for the IoT Platform cloud APIs.
Common request parameters
Common request parameters are parameters that you must include in every API call.
Name | Type | Required | Description |
Format | String | No | The format of the return value. Valid values are JSON and XML. The default value is XML. |
Version | String | Yes | The version number of the API. The version is in the |
AccessKeyId | String | Yes | The AccessKey ID that Alibaba Cloud issues for service access. Log on to the Alibaba Cloud Management Console. Move the pointer over your profile picture and click accesskeys to go to the User Information Management page. You can create and view your AccessKey on this page. |
Signature | String | Yes | The signature string. |
SignatureMethod | String | Yes | The signature algorithm. Only HMAC-SHA1 is supported. |
Timestamp | String | Yes | The timestamp of the request. The date must follow the ISO 8601 standard and be in UTC. The format is For example, |
SignatureVersion | String | Yes | The version of the signature algorithm. The current version is 1.0. |
SignatureNonce | String | Yes | A unique random number. This parameter prevents replay attacks. Use a different random number for each request. |
RegionId | String | Yes | The region where the device is located. This corresponds to the region in the console, such as cn-shanghai. |
Examples
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-shanghaiCommon response parameters
API responses use a standard format. A 2xx HTTP status code indicates that the call was successful. A 4xx or 5xx HTTP status code indicates that the call failed. For successful calls, the response data is returned in either XML or JSON format. You can specify the response format in the request. The default format is XML.
For every API call, the system returns a unique request ID, regardless of whether the call was successful.
Example of a successful response
XML format
<?xml version="1.0" encoding="UTF-8"?> <!--Root node of the result--> <APINameResponse> <!--Request tag--> <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <!--Response data--> </APINameResponse>JSON format
{ "RequestId": "4C467B38-3910-447D-87BC-AC049166F216" /* Response data */ }
Example of a failed response
If an API call fails, no result data is returned. You can use the returned error code to identify the cause of the error.
When a call fails, the HTTP request returns a 4xx or 5xx HTTP status code. The response body contains the specific error code, error message, and a globally unique request ID (RequestId).
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." }