Cmp General

General #

The IOT APIs system currently only shows support for functions such as package, orders, and traffic

API Request #

API request body is comprised of parameters that are used to request information from IOT platform

request header #

You do not perform access_token authentication for external apis, but perform signature verification through API gateway. For details about how to generate signatures, see Generating the signature

Across the APIs, below are the common request header and their descriptions:

Parameter name Schema Required Description Default Example Fixed value
X-HMAC-SIGNATURE string true Indicates the signature generated by the signature algorithm specified by X-HMAC-ALGORITHM 8XV1GB7Tq23OJcoz6wjqTs4ZLxr9DiLoY4PxzScWGYg= false
X-HMAC-ALGORITHM string true Signature algorithm hmac-sha256 hmac-sha256 true
X-HMAC-ACCESS-KEY string true Client Access Key access-key false
Date string false GMT format date character string Tue, 19 Jan 2021 11:33:20 GMT false
X-HMAC-SIGNED-HEADERS string false Specify the request header name to participate in signature calculation, multiple use ; separate Accept-Language;Content-Type true
Accept-Language string true i18n Internationalization identity zh-CN en-US false
Content-Type string true Content type application/json application/json true

sample #

//sample code 
curl -i "https://127.0.0.1:9080/index.html?name=james&age=36" \
-H "X-HMAC-SIGNATURE: 8XV1GB7Tq23OJcoz6wjqTs4ZLxr9DiLoY4PxzScWGYg=" \
-H "X-HMAC-ALGORITHM: hmac-sha256" \
-H "X-HMAC-ACCESS-KEY: user-key" \
-H "Date: Tue, 19 Jan 2021 11:33:20 GMT" \
-H "X-HMAC-SIGNED-HEADERS:Accept-Language;Content-Type" \
-H "Accept-Language:en-US" \
-H "Content-Type:application/json"

API Response #

Reponse usually follows below format:

{
  "code": "0000",
  "message": "string",
  "data": {}
  
}
Name Schema Description
code string Response code 0000 is successful
message string Response message.
data json or null Response result information.

Response verification signature #

The request header of Response returns the necessary parameters for signature calculation. For specific steps, refer to:

Response verification signature

Response code #

HTTP code #

Code Description
0000 Success
401 Authentication failure
403 Deny access
404 Not found

Business code #

Code Description
9999 null
0089 This interface does not support this partner
0103 There is no order in progress for this device
0127 Request path error
0153 The parameter cannot be empty