OneNET IoT Platform Platform Introduction Introduction Manual Guidline for Device Development Guideline for Application Development
API
API Usage API List SDK MQTT LwM2M EDP Modbus TCP
HTTP Push

View Cache Command List of Specified Device

Request Method: GET

URL: http://iot.zong.com.pk:8000/nbiot/offline/history

http Header

Parameter Name Format Required Description
api-key string yes must be masterkey or apikey with access authority of the device

url Parameter

Parameter Name Format Required Description
imei string yes identity code of nbiot device
start string yes specify start time
end string no specify end time
page int no current number of pages
per_page int no number of displays per page
sort string no time sequencing (ASC/DESC), default to DESC

Return Parameter

Parameter Name Format Description
errno int code for call error , 0 indicates call is successful
error string error description, "succ" indicates call is successful
data json Related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
count int number of cache commands
items array-json json array of cache command, see item description table
trigger_msg int upstream message type triggered by command. ranges of value [1,7]
item Description Table
Parameter Name Format Description
cmd_uuid string cache command id
type string command type
create_time string command creation time
valid_time string time for command to take effects
expired_time steing time for command to expire
send_time string time to send command
send_status int sending status
confirm_time string response time
confirm_status string response status
Description

send_status status:

1. Wait Command (wait)
2. Cancel Command (cancle)
3. Command had been sent to device(send)
4. Command expired (expired)
5. Send Command successfully (success)
6. Send Command failed (failed)
7. Other unknown errors (undefined)

confirm_status status:

0. SUCCESS (command execute success)
1. METHOD_NOT_ALLOWED (object or resource does not allow this operation)
2. FORBIDDEN (terminal is unregistered)
3. NOT_FOUND (no object or resource was found)
4. INTERNAL_SERVER_ERROR (device response code error, etc.)
5. TIME_OUT (device response timeout)
6. REQ_PARAM_ERROR (request parameter error)
7. RESP_ERROR (device response message error)
8. UNAUTHORIZED (access not allowed)
9. BAD_REQUEST (request format error, such as short of parameter or code, etc.)
10. NOT_ACCEPTABLE (no preferred message format can be returned)
11. UNSUPPORTED_CONTENT_FORMAT (specified message format not supported)

trigger_msg trigger type:

1. REGISTER
2. UPDATE
3. REGISTER | UPDATE COMBINATION
4. NOTIFY
5. REGUSTER | NOTIFY COMBINATION
6. UPDATE | NOTIFY COMBINATION
7. NOTIFY | UPDATE | REGISTE COMBINATION

Example of Request

GET http://iot.zong.com.pk:8000/nbiot/offline/history?imei=86582003***&start=2016-08-05T08:00:00&end=2016-08-06T08:00:00&page=2&per_page=10 HTTP/1.1
api-key: WhI*************v1c=
Host: iot.zong.com.pk:8000
Content-Length: 196

Example of Return

{
    "errno": 0,
    "data": {
        "count":100,
        "items":[
            {
                "cmd_uuid":"f6869ecb-3dc1-5374-9be0-4fb961f8af3c ",
                "type":"READ",
                "create_time":"2017-08-28 11:34:58",
                "valid_time":"2017-08-28 11:34:58",
                "expired_time":"2017-08-28 11:34:58",
                "send_time":"2017-08-28 11:34:58",
                "send_status": 5,
                "confirm_time": "2017-08-28 11:34:58",
                "confirm_status": "SUCCESS",
            }
            {
                ...
            }
        ],
        "trigger_msg":3
    },
    "error": "succ"
}

results matching ""

    No results matching ""