Common parameters
This topic describes the common request and response parameters for the cloud APIs of IoT Edge.
Common request parameters
Common request parameters are required for every API call.
Name | Type | Required | Description |
Format | String | No | The format of the return value. Supported formats are JSON and XML. The default value is XML. |
Version | String | Yes | The API version number. The date format is Available versions:
|
AccessKeyId | String | Yes | The AccessKey ID issued by Alibaba Cloud for service access. Log on to the Alibaba Cloud Management Console. Move the mouse pointer over your profile picture and click AccessKey Management to go to the AccessKey page. On this page, create and view your AccessKey. |
Signature | String | Yes | The signature string. For more information, see Signature mechanism. |
SignatureMethod | String | Yes | The signature method. Only HMAC-SHA1 is supported. |
Timestamp | String | Yes | The timestamp of the request. The timestamp 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 number is used to prevent replay attacks. A different random number must be used for each request. |
RegionId | String | Yes | The ID of the region where the device is located. This ID corresponds to the region in the console. For example, cn-shanghai. For the region IDs supported by IoT Platform, see Supported regions. |
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-shanghaiCommon response parameters
API responses use a standard format. A 2xx HTTP status code indicates that the call is successful, while a 4xx or 5xx HTTP status code indicates that the call failed. For successful calls, response data is available in XML or JSON format. You can specify the desired format in the request. The default format is XML.
For every API call, regardless of whether it is successful, the system returns a unique request ID, RequestId.
Example of a successful response
XML format
API version 2022-01-01
<!--Request ID--> <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <!--Response data-->API version 2018-01-20
<?xml version="1.0" encoding="UTF-8"?> <!--Root node of the result--> <API name+Response> <!--Request ID--> <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <!--Response data--> </API name+Response>
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 identify the cause of the error from the error code.
When a call fails, the HTTP request returns a 4xx or 5xx HTTP status code. The response body contains a specific error code, an error message, and the 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." }