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

Query apikey

Request format: GET

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

URL Parameters

Name Format Required or not Description
key string No Used to query the details of a single apikey.
device_id string No Used to query the apikey related to a device ID.
page string No Specify the page number.
per_page string No Number of outputs per page, 10 by default, max. 100

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 For the related information returned after the interface is called successfully, see the data description table.
Data Description Table
Name Format Description
total_count int Number of devices in the query result
page int Current page
per_page int Number of devices per page
keys array- json Json array of device information. See the description table of keys.
Description table of keys
Name Format Description
create_time string Creation time. Example: 2017-08-22 11:52:29.
key string apikey content
permissions array- json Resource access permission (see New API)
title string Apikey name

Request Example 1

Query of details of an apikey

GET http://api.onenet.hk.chinamobile.com/keys?key=7RM**************ao= HTTP/1.1

Return Example 1

{
    "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"
}

Request Example 2

Query of details of device-related apikeys

GET http://api.onenet.hk.chinamobile.com/keys?device_id=39593230 HTTP/1.1

Return Example 1

{
    "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"
}

个搜索结果,搜索内容 “

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