• CMP Api

    • CMP
    • Introduction
    • Flow
    • General
    • Generating the signature
    • Response verification signature
    • Apis
  • CMP Api

    • CMP
    • Introduction
    • Flow
    • General
    • Generating the signature
    • Response verification signature
    • Apis
  • CMP Api

    • CMP
    • Introduction
    • Flow
    • General
    • Generating the signature
    • Response verification signature
    • Apis

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 nameSchemaRequiredDescriptionDefaultExampleFixed value
X-HMAC-SIGNATUREstringtrueIndicates the signature generated by the signature algorithm specified by X-HMAC-ALGORITHM8XV1GB7Tq23OJcoz6wjqTs4ZLxr9DiLoY4PxzScWGYg=false
X-HMAC-ALGORITHMstringtrueSignature algorithmhmac-sha256hmac-sha256true
X-HMAC-ACCESS-KEYstringtrueClient Access Keyaccess-keyfalse
DatestringfalseGMT format date character stringTue, 19 Jan 2021 11:33:20 GMTfalse
X-HMAC-SIGNED-HEADERSstringfalseSpecify the request header name to participate in signature calculation, multiple use ; separateAccept-Language;Content-Typetrue
Accept-Languagestringtruei18n Internationalization identityzh-CNen-USfalse
Content-TypestringtrueContent typeapplication/jsonapplication/jsontrue

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": {}
  
}
NameSchemaDescription
codestringResponse code 0000 is successful
messagestringResponse message.
datajson or nullResponse 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

CodeDescription
0000Success
401Authentication failure
403Deny access
404Not found

Business code

CodeDescription
9999null
0089This interface does not support this partner
0103There is no order in progress for this device
0127Request path error
0153The parameter cannot be empty
Edit this page on GitHub
Prev
Flow
Next
Generating the signature