Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

The new user management UI enables you to assign users to groups. But creating new groups is currently not available via UI. So this is a guide which leads you through the calls needed for it.

...

  • Token of a user / service-user which has admin role (chat.admin.all) assigned → <yourToken>

  • The base URL of your application → <baseUrl>

Panel
panelIconId2139
panelIcon:information_source:
panelIconTextℹī¸
bgColor#E6FCFF

Check here how to get a token: How to get a Token for our APIs

Fetching groups

With the following cURL you can fetch all available groups of the organisation the user/service-user belongs to. Just replace the following placeholders: <baseUrl> / <yourToken>

Insert excerpt
API APIs & IntegrationsAPI
APIs & Integrations
nameinternal-api-warning
nopaneltrue

...

Now lets create a group. This can be done with this cURL. Just replace the following placeholders: <baseUrl> / <yourToken> / <groupName> / <parentId>

Insert excerpt
API APIs & IntegrationsAPI
APIs & Integrations
nameinternal-api-warning
nopaneltrue

...

In case you did a typo or a name of a group changed you can update an existing group with the following cURL. Just replace the following placeholders: <baseUrl> / <yourToken> / <groupId> (ID of the group you want to change) / <groupName> (new name you want to set)

Insert excerpt
API APIs & IntegrationsAPI
APIs & Integrations
nameinternal-api-warning
nopaneltrue

...

Code Block
{
    "data": {
        "updateGroup": {
            "id": "<groupId>",
            "name": "<groupName>"
        }
    }
}

Updating Metadata

The same cURL command can be used to add/update metadata to a group. The metadata can be passed within the parameter named configurationin the input object.

Below you can see an example where the metadata with key location with a value switzerland is added to the group specified with <groupId>.

Code Block
curl --location 'https://gateway.<baseUrl>/scope-management/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <yourToken>' \
--data '{"query":"mutation UpdateGroup($updateGroupId: String!, $input: GroupUpdateInput!) {\n  updateGroup(id: $updateGroupId, input: $input) {\n    id\n  }\n}","variables":{"updateGroupId":"<groupId>","input":{"configuration": {"location": "switzerland"}}}}'

Deleting Groups

A group can be delted as follows, make sure the groups do not have members anymore.

Code Block
curl --request POST \
    --header 'content-type: application/json' \
    --header 'Authorization: Bearer <your Token>' \
    --url https://gateway.<baseUrl>/scope-management/graphql \
    --data '{"query":"mutation DeleteGroup($deleteGroupId: String!) {\n  deleteGroup(id: $deleteGroupId) {\n    id\n  }\n}","variables":{"deleteGroupId":"group_...."}}'

...