We are using the following SDK version
https://sdk-cdn.mypurecloud.com/javascript/140.0.0/purecloud-platform-client-v2.min.js
We are performing an implicit grant with an OAuth token that has the outbound scope associated with it. In our code we are calling:
outboundApi = new platformClient.OutboundApi();
outboundApi.getOutboundContactlistContact(dialerContactListId, dialerContactId)
which is successfully returning us the contact information and campaign Id. We are then using the campaign id to perform the following to get the campaign name:
outboundApi.getOutboundCampaign(dialerCampaignId)
and this fails with the following error.
**
code: "missing.any.division.permissions"
status: 403
message: Unable to perform the requested action. You must have at least one of the following permissions assigned: [outbound:campaign:view] in at least one of the following division(s)**
Can anyone advise on where this permission needs to be set and where? The OAuth has the outbound scope and the authorised application has the same. We are able to get the contact list information with the current permissions but cannot get the campaign name via the ID?
Hello,
"Can anyone advise on where this permission needs to be set and where?"
As you are using an OAuth Implicit Grant flow to get your token, the permission must be assigned to your Genesys Cloud user (the user who is accessing your application - webapp I assume). This permission can be assigned to the user, via a Role (assigned to the user directly, assigned to a Group the user belongs to, ...).
Some permissions are also division aware. So you should enable the role for all necessary divisions you want to gather data from.
"We are able to get the contact list information with the current permissions but cannot get the campaign name via the ID?"
These endpoints require different permissions. You can find the required permissions under the Operation Information of an API endpoint in the API Explorer.
The GET /api/v2/outbound/contactlists/{contactListId} to retrieve details about a contact list requires the outbound:contactList:view
The GET /api/v2/outbound/campaigns/{campaignId} to retrieve details about a campaign requires the outbound:campaign:view permission
Your user likely has the first permission assigned to him (outbound:contactList:view), and enabled for at least one division (via the role assignment to user/group), but is likely missing the second permission (outbound:campaign:view) or has no division assigned/set (via the role assignment to user/group).
Regards,
If we assign this permission to an agent, they then get access to the ADMIN menu item which we do not want. How do we allow them to get a campaign via the campaign ID in the interaction information without giving them access to the ADMIN menu item?
Is there another API/Permissions combination we can use to obtain the campaign information without giving the user the ADMIN menu item? I can see a permission for outbound:campaign:search. Is there a search API that will take a campaign ID and return the campaign object (or even just the campaign name)?
I don't think that will be possible.
What I can say is that the getOutboundCampaign method triggers the GET /api/v2/outbound/campaigns/{campaignId} endpoint, which requires this outbound:campaign:view permission.
Doing a quick test, adding this permission to a "basic" user, this indeed enables the Admin - Outbound - Campaign Management view.
So I don't think there is a workaround.
You may try to submit an idea and share your use case for it at https://genesyscloud.ideas.aha.io/
Regards,
Ok I thought this was the case. thanks for your quick response. I will see if I can raise an fix/enhancement with the ideas team so the agent can make use of the APIs without being given the admin user interface options.