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

# Add apikey

Request Method: POST

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

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_method 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

POST http://iot.zong.com.pk:8000/keys HTTP/1.1

Example of Request body

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

results matching ""

    No results matching ""