-
Notifications
You must be signed in to change notification settings - Fork 1
TokensAdd (Privilege Key)
Samuel Grant edited this page Jun 23, 2020
·
5 revisions
Creates a privilege key
Notes:
-
Custom Fields (optional) can be attached to a privilege key. When the key is consumed the user will inherit these custom fields. You can search for a user using a custom field making this the way to link users to specific accounts on other applications
-
This function only supports privilege keys that assign server groups. This is a limitation of the library and not Team Speak.
Want this adjusted? Open a new issue
-
The description should not be escaped as that will be handled by the function
| Name | Type | Description |
|---|---|---|
| sgid | int64 | ID of the server group that will be granted when a user consumes the token |
| description | string | Privilege key description, visible through the server query and TS Client |
| customFields | map[string]string | Key value pair for custom fields |
**
| Type | Description |
|---|---|
| *status | Query Response |
| *PrivilegeKey | The token that was created |
| error |
qres, err := client.TokensAdd(sgid, "un escaped description", map[string]string{"key": "val"})
if err != nil || !qres.IsSuccess() {
// Handle error or rejected server query
}