In some cases, groups may have been created manually via the employee app, which need to be filled with users via the API afterwards.
In this case, it is necessary to query the ID of these groups via the GET "Get all existing groups" request first. All groups that do not have an external_ID in the query were created manually in the app either via Excel import or via the admin dashboard.
Assign external ID
To make groups without external_ID available for the user import via the API, an external_ID must be assigned. For this purpose, the POST request "Create or update multiple groups at once", the one from the previous request is provided in the optional field group_ID and additionally a new unique value is assigned in the field external_ID by the customer.
In order to import the users into a group which is newly available for the API, it should be ensured that the intended users have a "member of" tag which has the newly assigned external_ID of the group as value.
You want to add users to the group "Location Stuttgart" via the API.
- Using the "Get all existing groups" request you are looking for the group with the name "Location Stuttgart". From this specific group you note the ID, which is the internal_ID of the group.
- Now you can update the group using the "Create or update multiple groups at once" request and turn it into an external group. To do so, you enter the ID of the internal group you found out in the previous step as group_ID. As external_ID you set a value with which you can identify the group in your system later. The remaining fields are filled with new information or transferred from the request in step 1.
- Now you can add users to this group via the API. To do so, use the "Create or update multiple users at once" request. In this request you set a tag with the key "memberOf" for the corresponding users and as value you use the external_ID that was assigned to the group in the previous step. The group "Location Stuttgart" can now be managed via the API. In further requests you don't have to send the group_ID to update the group.