Genesys Cloud - Using the Mindful GetOffer API
Update the Genesys Cloud integration to use the Mindful API.
This guide updates the Genesys Cloud and Mindful integration guide to use the Retrieve callback offer decision attributes endpoint of the Mindful API to determine whether to send inbound calls to Mindful. This endpoint returns data to help you make an informed decision for call routing, including a boolean shouldOffer KVP. As with the main integration guide, the configuration, Architect Flows, and Actions described here are examples that may be used as templates for integrating with Mindful.
Overview
This guide covers the following topics:
- Definitions and acronyms
- OAuth Integration
- Data Actions
- Token Retrieval
- Get Offer Decision
- Inbound Architect Flow
Definitions and acronyms
Term | Description |
---|---|
API | Application Programming Interface – a set of functions that allows applications to perform requests against the application providing the API |
ECBT | Estimated Callback Time as calculated by Mindful Callback that can be used in place of the Genesys Cloud calculated wait time to make routing decisions |
JSON | JavaScript Object Notation - a lightweight format for storing and transporting data |
Mindful Callback | Part of the Mindful platform that provides the capability to request and receive callbacks |
Mindful API | A feature of Mindful that allows Call Target status to be requested via API from third-party applications/platforms via Application Client Credentials |
shouldOffer | The variable that will be analyzed in order to make a decision in the Flow on whether to route a call to Mindful or Transfer to agents |
Integrations
You will need an OAuth Integration to authenticate with the Mindful API via the Data Action that will be created later.
Creating an OAuth Integration
Admin > Integrations > Integrations
-
Click +Integration, then locate the Web Services Data Actions tile.
-
Click Install on the tile.
-
Enter a name on the Details Tab, then open the Configuration tab.
-
Select the Credentials sub-tab on the left, then click Configure.
-
In the Credentials Type drop-down menu, select User Defined (OAuth).
-
Enter the following four Credential Fields, and contact the Mindful Solution Delivery team for the values:
-
loginUrl
-
clientId
-
clientSecret
-
scope
-
-
Return to the Integrations page and set the toggle switch in the Status column to Active.
Data Actions
Two Data Actions are needed for this integration. The first will retrieve a temporary access token required for the Mindful API. The second will send a request to the API after a token has been obtained.
Token Retrieval
Admin > Integrations > Actions
-
Click Add Action on the Actions tab of the Integrations page.
-
In the Integration Name field, select the OAuth Integration created in the previous section.
-
Enter a name for the Action, then click Add.
-
On the Setup tab, add a string named "access_token" to the Output Contract Schema.
This string will be assigned the value of the temporary token returned from the Mindful Authentication endpoint. The token can then be used in a later Action.
-
Open the Configuration sub-tab, still within the Setup tab.
-
On the right side of the page, verify that the Available Inputs include "Raw Request (string)" and the Available Outputs include "access_token (string)".
-
Open the Test sub-tab, then click Run Action.
You should see a token returned if the test succeeds.
-
Click Save & Publish after a successful test.
-
Lastly, verify that the newly created Action shows “Published” in the Status column of the Actions tab.
Get Offer Decision
Next, you'll need an Action to send a request to the Retrieve callback offer decision attributes API endpoint.
-
Click Add Action on the Actions tab of the Integrations page to begin.
-
In the Integration Name field, select the Integration used for other Mindful-related Actions, as described in the main Genesys Cloud integration guide.
-
Enter a name for the Action, then click Add.
-
Open the new Action, then open the Setup tab.
-
Add the following two strings to the Input Contract Schema:
-
CallTarget_URL
-
AuthToken
-
-
In the Output Contract, add the following nested Object as the Response:
{ "title": "OfferResponse", "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "integer" }, "shouldOffer": { "type": "boolean" }, "isEndOfDay": { "type": "boolean" }, "afterHours": { "type": "boolean" }, "registrationEnabled": { "type": "boolean" }, "offeringAsap": { "type": "boolean" }, "offeringScheduleVoice": { "type": "boolean" }, "offeringScheduleWidget": { "type": "boolean" }, "offeringChooseHold": { "type": "boolean" }, "offeringTextIntercept": { "type": "boolean" }, "offeringNextDay": { "type": "boolean" }, "availableTimeslots": { "type": "boolean" }, "estimatedCallbackTime": { "type": "integer" } }, "additionalProperties": true } }, "additionalProperties": true }
-
Verify that the Output Contract contains all of the properties included in the JSON object, as shown below:
-
Open the Configuration sub-tab, still within the Setup tab.
-
On the right side of the page, verify that the expected inputs are available:
- Available Inputs:
- CallTarget_URL (string)
- AuthToken (string)
- Raw Request (string)
- Available Outputs:
- data (object)
- Available Inputs:
-
Open a new browser tab and run a new test of the Token Retrieval Action, then copy the token that is returned.
-
Back on the Get Offer Action, open the Test sub-tab and paste the new token into the AuthToken field.
-
Enter the Offer Decision endpoint URL in the CallTarget_URL field, including your Call Target ID.
Note: To obtain your Call Target ID, see the documentation for the Retrieve all Call Targets endpoint. To obtain the Get Offer endpoint URL, see the documentation for the Retrieve callback offer decision attributes endpoint. -
Execute the test after entering the required information.
-
Verify that the results contain all of the return values expected for the offer-decision API endpoint:
-
Click Save & Publish after a successful test.
-
Lastly, verify that the newly created Action shows "Published" in the Status column of the Actions tab.
Inbound Architect Flow
This guide assumes that you will update the existing Inbound Architect Flow detailed in the main Genesys Cloud integration guide. To utilize the new Data Actions created in the previous section, three new blocks are needed in the Flow. The following blocks are needed before the Datastore Post block and/or the Transfer to Mindful block:
-
Call Data Action to retrieve the OAuth token
-
Call Data Action to perform the offer-decision API call using the OAuth token
-
Decision block to evaluate the shouldOffer boolean response
-
Add a Call Data Action block after the initial Find Queue block.
-
Category - Select the OAuth Integration that was created earlier.
-
Data Action - Select the Token Retrieval Data Action.
-
Success Outputs - In the access_token field, assign the variable Task.access_token.
-
-
Add another Call Data Action block on the success path of the Token Retrieval Data Action.
Category - For this new Call Data Action block, select the Integration that contains the Get Offer Data Action.
Data Action - Select the Get Offer Action created earlier.
-
Call Target URL - Enter the offer-decision endpoint URL, including your Call Target ID.
-
AuthToken - Assign the expression Task.access_token.
-
Success Outputs - Assign Task variables to each of the outputs you would like to capture and evaluate.
-
Finally, add a Decision block to evaluate the Task.shouldOffer boolean value (and any other variables of interest returned by the API) before routing the call to Mindful for a callback offer or transferring the call directly to agents.