This article describes the endpoints available for configuring Category access for Users and Groups.
/api/category_user: Retrieve, assign, remove Category access from a User./api/category_group: Retrieve, assign, remove Category access from a Group.
NOTE: Both endpoints are available for Metric Insights v7.0.2+.
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. Configure User Categories
2.1. Get User Categories
NOTE: The id of each category_user data entry is unique and can be used to create new data entries or delete the existing ones.
- GET request to
/api/category_userreturns all User-to-Category access mappings. - GET request to
/api/category_user/id/<ID>returns the selected User-to-Category access mapping.
- Item: category_user
- Method: GET
- Filter the results with the following parameters:
- ID: The ID of the
category_useraccess mapping. - category_id: The ID of the category
- user_id: The ID of the user
- ID: The ID of the
- Enter an API Token
- [Run request]
Example Response
{
"category_users": [
{
"id": 76,
"category_id": 111,
"user_id": 100,
"allow_edit_element": "No"
},
{
"id": 77,
"category_id": 123,
"user_id": 66,
"allow_edit_element": "No"
}
]
}
Fields Description
| Field Name | Value Type | Description |
category_users | array | Array containing all User-to-Category access mappings. |
id | integer | The ID of the category_users data entry. |
category_id | integer | The ID of the Category. |
user_id | integer | The ID of the User. |
allow_edit_element | string | Whether the User has edit access to the Elements in the Category.
|
2.2. Add Category Access to User
- POST request to
/api/category_userassigns Category access to a User.
- Item: category_user
- Method: POST
- Enter the ID of an existing category_user data entry
- See Get User Categories for details
- Modify the request by providing parameter values
- See Fields Description for details
- Enter an API Token
- [Run request]
2.3. Delete Category Access from User
- DELETE request to
/api/category_userremoves Category access from a User.
- Item: category_user
- Method: DELETE
- Enter the ID of category_user data entry that needs to be deleted
- See Get User Categories for details
- Enter an API Token
- [Run request]
3. Configure Group Categories
3.1. Get Group Categories
NOTE: The id of each category_group data entry is unique and can be used to create new data entries or delete the existing ones.
- GET request to
/api/category_groupreturns all Group-to-Category access mappings. - GET request to
/api/category_group/id/<ID>returns the selected Group-to-Category access mapping.
- Item: category_group
- Method: GET
- Filter the results with the following parameters:
- ID: The ID of the
category_groupdata entry - category_id: The ID of the category
- group_id: The ID of the group
- ID: The ID of the
- Enter an API Token
- [Run request]
Example Response
{
"category_groups": [
{
"id": 3,
"category_id": 58,
"group_id": 2,
"allow_edit_element": "No"
},
{
"id": 4,
"category_id": 59,
"group_id": 2,
"allow_edit_element": "No"
}
]
}
Fields Description
| Field Name | Value Type | Description |
category_groups | array | Array containing all Group-to-Category access mappings. |
id | integer | The ID of the category_groups data entry. |
category_id | integer | The ID of the Category. |
group_id | integer | The ID of the Group. |
allow_edit_element | string | Whether the Group members have edit access to the Elements in the Category.
|
3.2. Add Category Access to Group
- POST request to
/api/category_groupassigns Category access to Group members.
- Item: group_category
- Method: POST
- Enter ID of an existing category_group data entry
- See Get Group Categories for details
- Modify the request by providing values
- See Fields Description for details
- Enter an API Token
- [Run request]
3.3. Delete Category Access from Group
- DELETE request to
/api/category_groupremoves Category access from Group members.
- Item: category_group
- Method: DELETE
- Enter the ID of category_group data entry that needs to be deleted
- Enter an API Token
- [Run request]