Common parameters

Updated at:

This document describes the common request and response parameters for the IoT Mobile Connection Package API.

Common request parameters

Every API call requires common request parameters.

Name

Type

Required

Description

Format

String

No

The format of the response message. Valid values:

  • JSON

  • XML (default)

Version

String

Yes

The API version. The value is in the YYYY-MM-DD format. The latest version is 2021-05-20.

AccessKeyId

String

Yes

The ID of your AccessKey pair.

Log on to the Alibaba Cloud Management Console. Move the pointer over your profile picture and click AccessKey Management. On the Access Credentials page, create and view your AccessKeyId.

Signature

String

Yes

The message signature. For more information, see Signature mechanism.

SignatureMethod

String

Yes

The signature method. The value is HMAC-SHA1.

SignatureNonce

String

Yes

A unique random number. It is used to prevent replay attacks. Use a different random number for each request.

SignatureVersion

String

Yes

The signature algorithm version. The value is 1.0.

Timestamp

String

Yes

The timestamp of the request. The value must be in UTC and follow the ISO 8601 standard. The format is YYYY-MM-DDThh:mm:ssZ.

For example, 20:00:00 on January 10, 2013 (UTC+8) is represented as 2013-01-10T12:00:00Z.

The following code provides an example of common request parameters:

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

Common response parameters

API responses use a standard format. A 2xx HTTP status code indicates that the call was successful, and a 4xx or 5xx HTTP status code indicates that the call failed. For successful calls, the response data can be in XML or JSON format. You can specify the response format when you send a request. The default format is XML.

For each API call, the system returns a unique RequestId, regardless of whether the call was successful.

  • Successful response example

    • XML format

      <?xml version="1.0" encoding="UTF-8"?> 
      <!--The root node of the result-->
      <APIName+Response>
          <!--The request ID-->
          <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
          <!--The response data-->
      </APIName+Response>
    • JSON format

      {
          "RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
          /* The response data */
      }
  • Failed response example

    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 the specific error code, error message, and a 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."
      }