Talkdesk - using the Mindful GetOffer API
Update the Talkdesk integration to use the Mindful API.
This guide updates the Talkdesk 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 or route them to agents. The API returns data to help you make an informed decision for call routing, including a boolean shouldOffer property.
As with the main integration guide, the configuration described here presents examples that may be used as templates for integrating with Mindful.
Overview
This guide covers the following topics:
- Definitions and acronyms
- Configure a Custom Integration
- Create a new Action
- Update the Studio 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 Talkdesk 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 |
Configure a Custom Integration
To accommodate the changes to the Studio Flow covered later in this guide, you will need a new OAuth Integration:
-
Open the Integrations page in Talkdesk, then click Add Integration in the Custom Integration tab.
-
When prompted, complete the required fields in the Basic Information window:
-
Name and Description — Enter a name and description for the new Custom Integration.
-
Authentication Type — Select "OAuth2 Client Credentials With Scopes".
-
Consult the Mindful Solution Delivery team to obtain values for the remaining fields:
-
Base path
-
Client ID
-
Client Secret
-
Access Token URL
-
Scopes
-
-
Create a new Action
After creating the Custom Integration, you will need a new Action that can be invoked in the Studio Flow:
-
In the Actions tab, click Add Action.
-
In the Basic Information section, enter a name and description for the Action.
-
In the URL Settings section, enter v2/callback/callTargets/{{calltarget_id}}/offerDecision?sourceType=voice into the Retrieve Path field.
-
Configure one path parameter:
-
Parameter — calltarget_id
-
Parameter type — String
This will replace the {{calltarget_id}} variable in the Retrieve path URL.
-
-
In the Inputs and Outputs section, add the following schema to the Output Schema field:
{ "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://example.com/object1723836626.json", "title": "Root", "type": "object", "required": [ "data" ], "properties": { "data": { "$id": "#root/data", "title": "Data", "type": "object", "required": [ "id", "shouldOffer", "processingEnabled", "isEndOfDay", "afterHours", "registrationEnabled", "offeringAsap", "offeringScheduleVoice", "offeringScheduleWidget", "offeringChooseHold", "offeringTextIntercept", "offeringNextDay", "availableTimeslots", "estimatedCallbackTime" ], "properties": { "id": { "$id": "#root/data/id", "title": "Id", "type": "integer", "examples": [ 4376 ], "default": 0 }, "shouldOffer": { "$id": "#root/data/shouldOffer", "title": "Shouldoffer", "type": "boolean", "examples": [ true ], "default": true }, "processingEnabled": { "$id": "#root/data/processingEnabled", "title": "Processingenabled", "type": "boolean", "examples": [ false ], "default": true }, "isEndOfDay": { "$id": "#root/data/isEndOfDay", "title": "Isendofday", "type": "boolean", "examples": [ false ], "default": true }, "afterHours": { "$id": "#root/data/afterHours", "title": "Afterhours", "type": "boolean", "examples": [ false ], "default": true }, "registrationEnabled": { "$id": "#root/data/registrationEnabled", "title": "Registrationenabled", "type": "boolean", "examples": [ true ], "default": true }, "offeringAsap": { "$id": "#root/data/offeringAsap", "title": "Offeringasap", "type": "boolean", "examples": [ true ], "default": true }, "offeringScheduleVoice": { "$id": "#root/data/offeringScheduleVoice", "title": "Offeringschedulevoice", "type": "boolean", "examples": [ false ], "default": true }, "offeringScheduleWidget": { "$id": "#root/data/offeringScheduleWidget", "title": "Offeringschedulewidget", "type": "boolean", "examples": [ false ], "default": true }, "offeringChooseHold": { "$id": "#root/data/offeringChooseHold", "title": "Offeringchoosehold", "type": "boolean", "examples": [ false ], "default": true }, "offeringTextIntercept": { "$id": "#root/data/offeringTextIntercept", "title": "Offeringtextintercept", "type": "boolean", "examples": [ false ], "default": true }, "offeringNextDay": { "$id": "#root/data/offeringNextDay", "title": "Offeringnextday", "type": "boolean", "examples": [ true ], "default": true }, "availableTimeslots": { "$id": "#root/data/availableTimeslots", "title": "Availabletimeslots", "type": "boolean", "examples": [ true ], "default": true }, "estimatedCallbackTime": { "$id": "#root/data/estimatedCallbackTime", "title": "Estimatedcallbacktime", "type": ["integer", "null"], "default": null } } } } }
Before publishing the Action, test to verify it is configured correctly. You will need the Call Target ID for this step.
If all is configured correctly, your test should result in a 200 Test Status Code, as seen below:
When finished, click Publish to commit the configuration and make it available to the Studio Flow. Once Published, the Action's status will change from "Draft" to "Active":
Update the Studio Flow
As part of the inbound call flow, the Studio Flow will check the "Retrieve callback offer decision attributes" API endpoint to ensure that calls are only sent to Mindful if the Call Target is in a state to offer a callback. Additionally, the Flow can play an EWT phrase to callers, using data returned from the API, to allow callers to make an informed decision.
Two new steps are required in the Flow:
Execute Action — Invokes the Custom Integration created earlier
Conditional Statement — Analyzes the API response to determine if the caller should be offered a callback or sent to queue for an agent
Execute Action step
After the up-front routing logic, add an Execute Action step.
In the Connections field, select the new Custom Integration created earlier.
In the Actions field, select the Action created earlier.
In the Inputs section, assign the Call Target ID to the
calltarget_id
variable.In the Outputs section, select "Parsed response".
Select a variable to hold the value of
data.shouldOffer
, which is the value of the offer decision.On the Exits tab, configure two exits:
Ok — Select the Conditional Statement step (after creating it in the next step of this guide).
Execution error — Select a path that leads to an agent queue.
Conditional Statement step
Add a Conditional Statement step to determine whether the shouldOffer
variable is "True" or "False". If true, the call can be routed down the path to offer a callback. If false, the call can be routed down the path that leads to the Agent queue.