Request format: POST
URL: http(s)://api.heclouds.com/nbiot
I only want to see examples!!!
Parameter Name | Format | Required? | Description |
---|---|---|---|
imei | string | 是 | nbiot device identity code |
obj_id | int | 是 | Object id of device, equivalent to the data flow id in the platform model, required |
obj_inst_id | int | 是 | id of a specific instance under nbiot device object, corresponding to a part of key value at the data point in the platform model, required |
mode | int | 是 | write mode; it can only be 1 or 2. |
timeout | int | 否 | Request time-out period, 25 by default (unit: s), value range [ 5,40] |
Parameter Name | Format | Required? | Description |
---|---|---|---|
data | array-json | yes | json data array of write device resource, size restricted to be 2k; see data request parameter description list. |
Parameter Name | Format | Required? | Description |
---|---|---|---|
res_id | int | yes | Resource id of specified write operation |
type | int | no | Support 1 and 2 at present. 1 means the resource type is Opaque; in such a case, val field is the hexadecimal character string corresponding to the binary system. 2 means the resource type is Time; in such a case, val field is the time stamp (expressed in seconds, value); If it’s left blank, it means the resource type is the basic data type. |
val | object | yes | Decide val data type according to the specified resource type; it can be boolean, string, long, double. |
Name | Format | Description |
---|---|---|
errno | int | Call error code, where 0 means success. |
error | string | Error description, where "succ" means success. |
Return to the meaning corresponding to errno status code; check API status code.。
1.mode value selection:
(1) represents replace, meaning to replace the specified instance or resource value;
(2) Represents partial update, meaning only updating the given resource or resource instance value.
HTTP content must exist.
Type field optional; at present, it supports 1 and 2. 1 means the resource type is Opaque; in such a case, val field is the hexadecimal character string corresponding to the binary system. 2 means the resource type is Time; in such a case, val field is the time stamp (expressed in seconds, value);)
POST http://api.heclouds.com/nbiot HTTP/1.1
api-key: WhI*************v1c= //Must be MasterKey, because it involves personal privacy, use "*******" instead
Content-Type: application/json
Authorization: version=2018-10-31&res=products/23104&et=1554398783&method=sha1&sign=fsBwuj0udOpU3BLoHmpbFwyIo30=
Non-opaque type:
{
"data":[
{
"res_id":12,
"val":121
}
]
} //The HTTP content part must exist.
opaque type:
{
"data":[
{
"res_id":12,
"type":1,
"val":121
}
]
} //The HTTP content part must exist.
{
"errno": 0,
"error": "succ"
} //In the response message, errno represents the error code, and error represents the cause of the error.