Custom user groups are groups that you can create and manage via the Learn365 API. Unlike Microsoft Entra groups, custom user groups can include users of any type, both Learn365 and Flow365.
This article describes the steps you should follow to add users to or remove them from a custom group.
To add users to or remove them from a custom group, you’ll need:
- User ID. You can find this via the API by following the steps in this article.
- User group ID. You can find this via the API by following the steps in this article.
Also, it’s worth checking which users are already in the custom group. To do that via API:
1. Go to https://api.365.systems/ and make sure you're authorized with the relevant API key.
2. In the Groups section, select the GET /services/users/Groups/{groupId}/members endpoint and select Try it out in the top right-hand corner.
3. Enter the ID of the user group in the groupId field.
4. Use query option parameters to control the data in the response, if required.
5. Select Execute to run the request.
6. Go to the Response block to check the results:
- 200 code with a list of users in the response body indicates a successful response.
- In case of errors, the response body contains the error object with the code and message keys explaining the issue.
Add users to a custom user group
To add users to a custom user group via API:
1. Go to https://api.365.systems/ and make sure you're authorized with the relevant API key.
2. In the Groups section, select the POST /services/users/Groups/{groupId}/members endpoint and select Try it out in the top right-hand corner.
3. Enter the ID of the user group in the groupId field.
4. In the request body array, enter the IDs of the users who you want to add to the group.
5. Select Execute to run the request.
6. Go to the Response block to check the results:
- 204 code with an empty response body indicates a successful response.
- In case of errors, the response body contains the error object with the code and message keys explaining the issue.
Remove users from a custom user group
There are two ways to remove users from a custom user group. To remove one or multiple users from a custom user group via API:
1. Go to https://api.365.systems/ and make sure you're authorized with the relevant API key.
2. In the Groups section, select:
- DELETE /services/users/Groups/{groupId}/members/{userId} to remove one user from a group. With this endpoint, enter the ID of the user group in the groupId field and the user ID in the userId field.
- DELETE /services/users/Groups/{groupId}/members to remove a list of users from a group. With this endpoint, enter the ID of the user group in the groupId field and, in the request body array, enter the IDs of the users who you want to remove from the group.
3. Select Execute to run the request.
4. Go to the Response block to check the results:
- 204 code with an empty response body indicates a successful response.
- In case of errors, the response body contains the error object with the code and message keys explaining the issue.
Comments
Article is closed for comments.