Multiprotocol Access Product Introduction QuickStart User Guide Development Guide
EDP TCP transparent transmission MQTT Modbus HTTP
FAQ

Send command

Request format: POST

URL: http://api.onenet.hk.chinamobile.com/cmds

URL Parameters

Name Format Required or not Description
device_id string Yes ID of the device receiving the data
qos int No Need for device response, 0 by default, 0: Send at most once, regardless of device response. 1: Send at least once. If the device does not respond after receiving the command, the command within the validity period (refer to the timeout parameter for the validity definition) will be resent in next device login.
timeout int No Command validity period, 0 by default. 0: Online command. If the device is online, the command will be sent to the device. If the device is offline, the command will be discarded directly. >0: Offline command. If the device is online, the command will be sent to the device. If the device is offline, the command will be valid within the current time plus timeout. If the device is online within the validity period, the command will be sent to the device. Unit: second Valid range: 0-2678400

http body内容

User-defined data: json, string, binary data (less than 64K)

http request return parameters

Name Format Description
errno int Call error code, where 0 means success.
error string Error description. “succ” means the call is successful.
data json Device-related information returned after interface is successfully called. See the Data Description Table.
Data Description Table
Name Format Description
cmd_uuid string Command id, unique within the platform

Request Example 1

POST http://api.onenet.hk.chinamobile.com/cmds?device_id=8029377 HTTP/1.1

<this is a command>

Return example 1: Successfully create a command.

{
    "errno": 0,
    "error": "succ",
    "data": {
        "cmd_uuid": "81572aae-fc34-5deb-8f06-ab45d73cb12b"
    }
}

Return example 2: The device is offline.

{
    "errno": 10,
    "error": "device not online: 8029377"
}

Request example 2: Send the offline command, requiring a device response.

POST http://api.onenet.hk.chinamobile.com/cmds?device_id=8029377&qos=1&timeout=3600 HTTP/1.1

<this is a command>

Return example

{
    "errno": 0,
    "error": "succ",
    "data": {
        "cmd_uuid": "81572aae-fc34-5deb-8f06-ab45d73cb12b"
    }
}

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “