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

Update apikey

Request format: PUT

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

key: to be replaced with the apikey that needs to be updated

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

PUT http://api.onenet.hk.chinamobile.com/keys/Av************RHxA= HTTP/1.1

Request parameter example

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

Note: The apikey update is an overwriting operation. That is, the original authorization resources and authorization commands will be overwritten and not be retained.

个搜索结果,搜索内容 “

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