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

Add apikey

Request format: POST

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

http body parameter

Name Format Required or not Description
title string Yes apikey name
permissions array- json Yes Array of permission description objects. See the description table of permissions.
access_methods array- string No Authorized access mode, with the options as follows: post: New resource get: Query resource put: Update resource delete: delete resource Note: There is no permission by default.
Permissions description list
Name Format Description
resources array- json List of authorized access resources See the description table of resources.
Description table of resources
Name Format Description
dev_id string Device ID of authorized access
ds_id string Data stream ID of authorized access

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 apikey information returned after the interface is called successfully, see the data description table.
Data Description Table
Name Format Description
key string apikey assigned by the system

Example of request header

POST http://api.onenet.hk.chinamobile.com/keys HTTP/1.1

Example of request body

{
    "title": "newapikey",
    "permissions": [{
        "access_methods": ["get", "put", "post", "delete"],
        "resources": [{
            "dev_id": "39593230",
            "ds_id": "gps"
        }, {
            "dev_id": "39456825"
        }]
    }],
}

Return Example

{
    "errno":0,
    "data": {
        "key":"Ave*************lIRHxA="
    },
    "error":"succ"
}

个搜索结果,搜索内容 “

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