Customize Button action on Scrip

Hi Guys,
I want to make a button starts a conference with some other actions. However, Purecloud data actions only support client credentials which is not allowed on Conversations API calls.

how do i create a button inside scrip for the agent to just click it to trigger the following :

POST : https://api.mypurecloud.com.au/api/v2/conversations/calls
I want to pass some values inside the body such as
{
"speakTo": "BOTH",
"destination": {
"address": "+61399999998",

}
}

I noticed Scripter has a built-in action called: Scripter.consulttTansfer but when i inspected that , i observed it only passes "speakTo": "DESTINATION" (see body below). Can i customize that to be BOTH? or is there any way to add/modify Scripter built in actions?

{
"speakTo": "DESTINATION",
"destination": {
"address": "+61399999998",

}
}

if I cant use the Conversations API from withing a script due to authentication miscompatibility , what is the best what to call those from within a script? i found out that i might be able to use an html page as a way to implement calls to Conversation but do i have to built that on a different server or can i pass a simple html code with AJAX inside the webpage settings (inside variable).

In case i need to use a webpage hosted on another server, how can i pass the user's information from his current account (already logged into webrtc, so can i pass the token from purecloud page) without requiring them to log into that embedded page to get a token again (using implicit grant) before being able to use the buttons on that embedded page). It would be easier if i can do everything from within scripter as the user object and session is already available with all the necessary information such as conversation ID, etc. not sure how can i pass all that to the embedded page to get details on the current running conversation.

I am thinking why Genesys added that API if we can't use it in the application?

any advice is highly appreciated.

thanks very much

If the available script actions don't do what you need, you'll need to build your own web app that authorizes with a user (probably use implicit grant, but could use auth code or saml2 bearer) and then makes the necessary API requests. This web app can be added to the script using a Web Page script component. If there's an auth cookie present when initiating the oauth flow (there should be), the agent won't see the login prompt and the authorization will happen without user input.

Many thanks, Tim.

I'll try that, although the webpage inside another page is a bit ugly :wink:

I'm thinking if it's possible by any means to edit the available Script Actions. Otherwise, a middleware API would be cleaner to implement on the script. It'd be perfect if there is a way to pass the user's token on to that middleware API, through the integration input.

Any thoughts?

Thanks again!

I'm thinking if it's possible by any means to edit the available Script Actions

It is not.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.