This article describes API calls available for Group Privilege Set configuration:
/api/group_privilege_set: Allows retrieving Privilege Sets assigned to Groups, adding, and removing Privilege Sets from Groups.
Prerequisites:
- Set up API access, verify that you have API access, and obtain a token via the get_token call OR
- Generate Personal API Token
Table of contents :
1. Access Admin > System > API Toolkit
2. Retrieve Privilege Sets Assigned to Groups
- GET request to
/api/group_privilege_setreturns all Privilege Set to Group mappings. - GET request to
/api/group_privilege_set/id/<ID>returns a single Privilege Set to group mapping by ID.
- Item: group_privilege_set
- Method: GET
- Optionally, apply filtering:
- group: Return all Privilege Sets assigned to a specified Group.
- privilege_set: Return all Groups that are assigned a specified Privilege Set.
- Enter an API Token.
- [Run request]
Example Response
{
"group_privilege_sets": [
{
"id": 1,
"group": 26,
"privilege_set": 5
},
{
"id": 2,
"group": 53,
"privilege_set": 2
},
{
"id": 3,
"group": 63,
"privilege_set": 2
},
{
"id": 4,
"group": 63,
"privilege_set": 3
}
]
}
Fields Description
| Parameter Name | Value Type | Description |
|---|---|---|
group_privilege_sets | array | Array containing all Privilege Set to Group mappings. |
id | integer | ID of a single Privilege Set to Group mapping. |
group | integer | ID of the Group. |
privilege_set | integer | ID of the Privilege Set assigned to the Group. |
3. Assign Privilege Set to Group
POST request to /api/group_privilege_set assigns a Privilege Set to a Group.
- Item: group_privilege_set
- Method: POST
- ID: Enter the ID of an existing Privilege Set to Group mapping.
- See Retrieve Privilege Sets Assigned to Groups for details.
- Select JSON request and provide the following values:
- group: The ID of the Group to which you want to assign the Privilege Set.
- privilege_set: The ID of the Privilege Set you want to assign to the Group.
- Enter an API Token.
- [Run request]
4. Remove Privilege Set from Group
DELETE request to /api/group_privilege_set/id/<ID> removes a Privilege Set from a Group.
- Item: group_privilege_set
- Method: DELETE
- ID: Enter the ID of an existing Privilege Set to Group mapping that you want to remove.
- See Retrieve Privilege Sets Assigned to Groups for details.
- Enter an API Token.
- [Run request]