# Add apikey
Request Method: POST
URL: http://api.heclouds.com/keys
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 |
Parameter Name | Format | Description |
---|---|---|
resources | array-json | authorized access resource list, see 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 |
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 |
Parameter Name | Format | Description |
---|---|---|
key | string | system-assigned apikey |
POST http://api.heclouds.com/keys HTTP/1.1
{
"title": "newapikey",
"permissions": [{
"resources": [{
"dev_id": "39593230",
"ds_id": "gps"
}, {
"dev_id": "39456825"
}]
}],
"access_methods": ["get", "put", "post", "delete"]
}
{
"errno":0,
"data": {
"key":"Ave*************lIRHxA="
},
"error":"succ"
}