RobertWC | 2020-02-24 23:50:32 UTC | #1
I can successfully use this in Developer Tools: /api/v2/conversations/calls/{conversationId}/participants/{participantId}/consult
When I try to use a Data action to run this in a script, it does not work. When testing the data action, it says it cannot be run because it requires user context.
Any way to get this API to work in a data action in a script?
tim.smith | 2020-02-25 17:32:16 UTC | #2
This is correct; data actions can only use client credentials and therefore many not have a user context. If you need to make user-authorized API requests from a script, you can embed a web page of your own construction to have the user authorize your app and make those requests.
RobertWC | 2020-02-25 18:34:27 UTC | #3
So, I have a button on a screen that is already user contact, but users cannot use the button because it runs as Oauth. I can run the same function in Developer tools logged in as that user. There is no way to bridge the same function?
anon28066628 | 2020-02-25 18:36:34 UTC | #4
Adding a quick aside for anyone else reading - Scripter does have a built-in Consult Transfer action. Maybe not applicable to this use-case though.
https://help.mypurecloud.com/articles/available-script-actions/
tim.smith | 2020-02-26 15:52:07 UTC | #5
RobertWC, post:3, topic:7193
I have a button on a screen that is already user contact, but users cannot use the button because it runs as Oauth
I don't understand what you mean.
RobertWC, post:3, topic:7193
I can run the same function in Developer tools logged in as that user.
Developer tools authenticates you as a user. Data actions use client credentials. Different authorization methods.
RobertWC, post:3, topic:7193
There is no way to bridge the same function?
As noted previously, you can create and embed a web app in the script. If the app is authorized with a user-based oauth flow (anything but client credentials), the app can make API requests that require a user context. If you're asking if data actions can have a user context, the answer is no because they can only authorize with client credentials.
system | 2020-03-28 16:01:26 UTC | #6
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: 7193