From Bright Pattern Documentation
setDialCandidates
Send the list of dial candidates to the Communicator Widget. Dial candidates represent entries which the agent could potentially dial (dial suggestions). These will be displayed on the UI of the dialpad screen, so agents can click and start interactions.
Request
Syntax
| setDialCandidates(candidates: DialCandidate[]): Promise<OperationResult<null>> |
Where:
| type DialCandidate = { id: string
displayName: string phones: PhoneData[] associatedObjects: InteractionAssociatedObjectData[] email?: string avatarUrl?: string } type PhoneData = { number: string type: PhoneType displayType?: string } type PhoneType = "mobile" | "business" | "home" | "fax" | "other" type InteractionAssociatedObjectData = { id: string type: string displayName: string displayType: string customFields: Record<string, string> } |
Parameters
| Parameter | Parameter Values | Data Type | Optional/Required | Description |
| candidates | object[] | Required | List of click-to-call entries | |
| id | string | Required | Unique ID | |
| displayName | string | Required | Name which will be displayed in the UI | |
| phones | object[] | Required | List of phone numbers to be used if an agent wants to start a call or chat from this entry. Agent will be able to choose one phone number from the list | |
| string | Optional | Email to display if user has no phone numbers | ||
| avatarUrl | string | Optional | URL of the avatar image to display | |
| associatedObjects | object[] | Required | List of CRM records to be associated with interactions started from this item |
Example Request
crmApi.getCurrentObjectOnScreen(data => {
if (data.objectType === 'contact') {
adApi.setDialCandidates([
{
id: data.uuid,
displayName: data.fullName,
phones: [
{
number: data.mobile,
type: "mobile",
},
],
associatedObjects: [
{
id: data.uuid,
type: "contact",
displayName: data.fullName,
displayType: "Customer",
customFields: {},
}
],
email: data.email,
}
])
}
})
Return Value
null