...
Token of a user / service-user which has admin role (chat.admin.all) assigned → <yourToken>
The base URL of your application → <baseUrl>
Check here how to get a token: Ingestion Configuration: MS Document Intelligence (Layout) PDF Ingestion
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 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Code Block |
---|
curl --location 'https://gateway.<baseUrl>/scope-management/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <yourToken>' \
--data '{"query":"query AllGroups {\n allGroups {\n id\n name\n parentId\n createdAt\n updatedAt\n }\n}","variables":{}}' |
This should give you the following result:
...
Now lets create a group. This can be done with this cURL. Just replace the following placeholders: <baseUrl> / <yourToken> / <groupName> / <parentId>
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Code Block |
---|
curl --location 'https://gateway.<baseUrl>/scope-management/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <yourToken>' \
--data '{"query":"mutation CreateGroup($input: GroupCreateInput!) {\n createGroup(input: $input) {\n id\n name\n parentId\n }\n}","variables":{"input":{"name":"<groupName>","parent":{"connect":{"id":"<parentId>"}}}}}' |
If you want to make the flat hierarchy (multiple “root groups”) then you can leave out the part with the parent. Doing it like this:
...
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 | ||||||||
---|---|---|---|---|---|---|---|---|
|
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":{"name":"<groupName>"}}}' |
This should give you the following result:
...