I am trying to create schedule callback using scripts where , The agent asks the client for a phone number and a time to receive a call during live chat with an agent.
My question is how to input their phone number and use it in scripter as its not part of the client data or participant data, neither included in chat registration form ?
I tried using scripts and schedule callback during the chat but its showing as "Failed to schedule callback"
The "Scripter.Schedule Callback" action is only meant for voice based conversations.
When triggered, the "Scripter.Schedule Callback" tries to create a callback as part of the existing conversation (i.e. add a callback media channel to the conversation).
It is in fact leveraging POST /api/v2/conversations/{conversationId}/participants/{participantId}/callbacks.
This request to add callback in the existing conversation is only allowed when the initial conversation is voice based.
That's why you are getting this "Failed to schedule callback" error when you invoke it from a chat conversation.
In order to schedule a callback from a chat conversation, you would need to create a Genesys Cloud Data Actions integration and create a Data Action which invokes POST /api/v2/conversations/callbacks
This API endpoint creates a callback conversation on its own (i.e. new conversation/new conversationId).
Note that you can pass custom attributes (participant data) as part of this request ("data" attribute in the request body).
You can trigger it from your Script using a "Data Actions.Execute Data Action" action.
The permissions required to invoke a Platform API endpoint are always documented (click on the selected endpoint in API Explorer on the Developer Center - links I gave in my previous post) under Operation Information section - Required Permissions.
For POST /api/v2/conversations/callbacks, this requires conversation:callback:create permission.
You can invoke the Data Action from a Script.
If you want to create your own HTML page to be displayed in Genesys Desktop, it would be an interaction widget integration. See Client Apps on the Developer Center.
Thank you for responding , I have created a agent script and used "create callback" data action but when I try to schedule callback it is throwing error as "Create Schedule Callback : unknown error".
Hello I don't know what you have in your "create callback" data action.
This is not a predefined data action - so someone imported a sample or created it.
So I can't guess what you have defined in the Request/Response configuration and Input/output contracts of this Data Action.
And you are not saying what variable you are settings/using when invoking your data action from the Script.
The dev forum is meant for questions related to the Platform API and SDKs.
For questions related to feature use and configuration, I'd suggest to ask on the Genesys Cloud CX Community site.
Thanks Jerome, One more question we are trying to set up a simple HTML page where its a UI outside of genesys and present the client a few simple fields for time, phone number, name, etc and show that we can get Genesis to then make that call
How to set up a HTML page outside of genesys and have fields like time, phone number, name, etc so that client can enter the details and schedule callback themselves , can you please help how can we achieve that?
You need to develop your web page (HTML and javascript) to manage the fields, ...
In order to submit the request to Genesys Cloud from that page, you'll need to leverage the Genesys Cloud Platform API - i.e. invoking the endpoint for callback (the one I had listed in my previous posts above).
In order to invoke the Platform API, you'll need to trigger an OAuth grant flow with Genesys Cloud to obtain a bearer/access token and be able to invoke the Platform API request - e.g. using an OAuth Implicit Grant client and flow: https://developer.genesys.cloud/authorization/platform-auth/guides/oauth/module-2-implicit-grant
But we need a phone setup to receive callbacks as an agent , but the phone icon itself is missing from my genesys pure cloud home page . How do I get it enabled and get ready as an agent to receive the scheduled callback?