Grant permissions

In this request, the auth-key is the client that has permissions to modify Access Manager permissions, not the auth-key you want to modify permissions on.

The one you are changing permissions for is within the parameters.

Path Parameters
sub_key string — REQUIRED

Your app's subscribe key from Admin Portal.

Example: sub-c-50264475-1902-558x-d213-7p19052012n2

Query Parameters
signature string — REQUIRED

Used to verify the request was signed with the secret key associated with the subscribe key. For information on how to compute the signature, refer to Signature generation.

Example: v2.k80LsDMD-sImA8rCBj-ntRKhZ8mSjHY8Ivngt9W3Yc4

auth string — REQUIRED

The Auth key that is being granted permissions.

Example: myAuthKey

uuid string

A UTF-8 encoded string of up to 92 characters used to identify the client.

Example: myUniqueUserId

timestamp integer — REQUIRED

Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 second offset from NTP. This is not associated with the TTL at all.

Example: 123456789

ttl integer

Time to live for permission to be valid.

Example: 123456789

channel string

The channel ID to perform the operation on. Comma separated values are accepted.

Example: myChannel,myChannel2

channel-group string

Comma-separated list of channel group names to perform the operation on.

Example: myChannelGroup1,myChannelGroup2

target-uuid string

Specifies the channel groups on which to grant permissions. Comma separated values are accepted.

Example: user-1,user-2

w integer

Possible values: [0, 1]

Write permission

Example: 1

r integer

Possible values: [0, 1]

Read permission

m integer

Possible values: [0, 1]

Manage permission

d integer

Possible values: [0, 1]

Delete permission

g integer

Possible values: [0, 1]

Get permission

u integer

Possible values: [0, 1]

Update permission

j integer

Possible values: [0, 1]

Join permission

Responses
200

OK

Schema — OPTIONAL
status number — OPTIONAL
message string — OPTIONAL
payload object — OPTIONAL
auths [object Object] — OPTIONAL
ttl number — OPTIONAL
channels — OPTIONAL
channel-groups — OPTIONAL
uuids object — OPTIONAL
subscribe_key string — OPTIONAL
level string — OPTIONAL
channel string — OPTIONAL
service string — OPTIONAL
400

Error validating inputs. (E.g. missing required params or invalid input types.)

403

Invalid signature. (E.g. wrong secret key or character set encoding for signature computation.)

* required
sub_key*
Type: string
Your app's subscribe key from Admin Portal.
* required
signature*
Type: string
Used to verify the request was signed with the secret key associated with the subscribe key. For information on how to compute the signature, refer to Signature generation.
auth*
Type: string
The Auth key that is being granted permissions.
uuid
Type: string
A UTF-8 encoded string of up to 92 characters used to identify the client.
timestamp*
Type: integer
Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 second offset from NTP. This is not associated with the TTL at all.
ttl
Type: integer
Time to live for permission to be valid.
channel
Type: string
The channel ID to perform the operation on. Comma separated values are accepted.
channel-group
Type: string
Comma-separated list of channel group names to perform the operation on.
target-uuid
Type: string
Specifies the channel groups on which to grant permissions. Comma separated values are accepted.
w
Type: integer
Write permission
r
Type: integer
Read permission
m
Type: integer
Manage permission
d
Type: integer
Delete permission
g
Type: integer
Get permission
u
Type: integer
Update permission
j
Type: integer
Join permission
status
Type: number
Example: 200
message
Type: string
Example: "Success"
payload
Type: object
service
Type: string
Example: "Access Manager"
Example Response
{
  "message": "Success",
  "payload": {
    "level": "uuid",
    "subscribe_key": "sub-key",
    "ttl": 1,
    "uuids": {
      "uuid-1": {
        "auths": {
          "authkey1": {
            "r": 0,
            "w": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          },
          "key2": {
            "r": 0,
            "w": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          }
        }
      },
      "uuid-2": {
        "auths": {
          "key1": {
            "r": 0,
            "authkey2": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          },
          "key2": {
            "r": 0,
            "w": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          }
        }
      }
    }
  },
  "service": "Access Manager",
  "status": 200
}