Lloyd | 2022-03-11 03:13:58 UTC | #1
I'm in the process of building a custom installer for a Premium app. As part of the installer process it creates a new Group, and creates a new Role.
Via the API I can assign the role to the new group successfully, but it shows as Roles are not enabled for that group in the UI
I can enable it via the UI and in the network trace I can see it calls: PUT https://api.mypurecloud.com.au/api/v2/groups/groupId/profile
However in the Javascript library, this doesn't exist
The only PUT that exists is PUT https://api.mypurecloud.com.au/api/v2/groups/groupId but the body is completely different.
So my question is how to Enable Roles for a known group through the JavaScript API (please)
Thanks L
crespino | 2022-03-11 15:30:30 UTC | #2
Lloyd,
Technically you don't need to create the group with the roles in them for a premium application. The group creation is a bit of a legacy thing that we used to use to gate visibility and access to the client application. However, "premium" client apps and interaction widgets now can have the role directly assigned in the integration definition to gate visibility and access.
With that said, thanks for bringing up this gap in our API. Apparently, programmatically creating a group and assigning roles to it isn't a common activity, but we'll look at filling that gap.
Thanks
crespino | 2022-03-11 17:00:56 UTC | #3
Lloyd,
My previous statement that groups w/ roles aren't technically necessary for AppFoundry premium applications still stands.
However, it was brought to my attention that the APIs to assign roles to a group are available. That API is not a part of the Group API as you might expect, but is instead a part of our roles endpoints in the Authorization API. Specifically, after you create the group, you would then use this endpoint to assign the roles to that group: https://developer.genesys.cloud/api/rest/v2/authorization/#post-api-v2-authorization-roles--roleId-
For example for each role you want to assign to the group you'll need to make an request that looks like this:
POST /api/v2/authorization/roles/2cd0c53f-9504-42f2-9892-8ba925e3e208?subjectType=PC_GROUP { "subjectIds":["5e9263c4-f038-4a12-b0f3-26488dd34cdc"], "divisionIds":["0edd806a-1a02-45f9-bc3a-32f430151b65"] }
Sorry for any confusion I created in my previous response.
Lloyd | 2022-03-13 19:59:23 UTC | #4
Thanks Jim,
I've got that step working already.
So I can add the role to the group successfully, and the UI the Roles show in the roles tab. -But the roles are not enabled for the group
Looks like adding the roles that is a separate step against the groups API to update the group profile But it's the group profile endpoint I can't find in the Javascript SDK
Are there additional parameters/options that can be added when adding the role to the group to also enable the role functions?
Thanks again Lloyd
system | 2022-04-13 19:59:51 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 13880