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

# Inquire apikey

Request Method: GET

URL: http://iot.zong.com.pk:8000/keys

URL Parameter

Parameter Name Format Required Description
key string no used to inquire single apikey detail
device_id string no used to inquire apikey related to a device ID
page string no specify page number
per_page string no output number of per page, default to 10, up to 100

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
total_count int number of devices in query results
page int current page
per_page int number of devices per page
keys array-json json array of device information, see keys description table
keys Description Table
Parameter Name Format Description
create_time string creation time, example: 2017-08-22 11:52:29
key string apikey content
permissions array-json access to resource permission (see Add api)
title string apikey name

Example 1 of Request

Inquire an apikey detail

GET http://iot.zong.com.pk:8000/keys?key=7RM**************ao= HTTP/1.1

Example 1 of Return

{
    "errno": 0,
    "data": {
        "per_page": 1,
        "total_count": 1,
        "keys": [{
            "title": "new1apikey",
            "create_time": "2017-08-22 11:52:29",
            "key": "7RM**************ao=",
            "permissions": [{
                "resources": [{
                    "dev_id": "39593230"
                }]
            }]
        }],
        "page": 1
    },
    "error": "succ"
}

Example 2 of Request

Inquir eapikey details related to a device

GET http://iot.zong.com.pk:8000/keys?device_id=39593230 HTTP/1.1

Example 1 of Return

{
    "errno": 0,
    "data": {
        "per_page": 30,
        "total_count": 2,
        "keys": [{
            "create_time": "2017-08-22 11:52:29",
            "permissions": [{
                "resources": [{
                    "dev_id": "39593230"
                }]
            }],
            "title": "new1apikey",
            "key": "7RM**************ao="
        }, {
            "create_time": "2017-08-23 09:01:45",
            "permissions": [{
                "resources": [{
                    "ds_id": "1312",
                    "dev_id": "39593230"
                }, {
                    "dev_id": "39456825"
                }]
            }],
            "title": "new2apikey",
            "key": "F=***************RQ="
        }],
        "page": 1
    },
    "error": "succ"
}

results matching ""

    No results matching ""