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

#Update apikey Request Method: PUT

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

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

http body Parameter

Parameter Name Format Required Description
title string yes apikey name
permissions array-json yes array of permission description object, see permissions description table
access_methods array-string no authorized access method, options are as follows
post: add resource
get: inquire resource
put: update resource
delete: delete resource
Note: does not have any permission by default
permissions Description Table
Parameter Name Format Description
resources array-json authorized access resource list, see resources description table
resources Description Table
Parameter Name Format Description
dev_id string device ID that authorized to access
ds_id string datastream ID that authorized to access

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 apikey related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
key string system-assigned apikey

Example of Request Header

PUT http://iot.zong.com.pk:8000/keys/Av************RHxA= HTTP/1.1

Example of Request Parameter

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

Example of Return

{
    "errno":0,
    "data": {
        "key":"Ave*************lIRHxA="
    },
    "error":"succ"
}
Note: apikey update is overlapping operation, which will overlap the existing authorized resources and authorized commands, and will not retain the original authorization resources and authorization commands

results matching ""

    No results matching ""