contactSearch
Defines which contacts the integration returns from an external CRM when users search for names or phone numbers before making calls or transferring interactions.
Notes:
- When using this method, include frameworkContacts as a value for
searchTargets
in thesettings
object. For more information, see searchTargets on the settings page. - When using this method, ensure to call the onSuccess or onFailure callback parameters. Otherwise, the user-initiated contact search does not complete until it times out.
Parameters
Name | Data type | Description | Notes |
searchValue | String | Name or phone number that the integration searches for in the external CRM. | |
onSuccess | Array of objects | Returns information about contacts when method is successful. See onSuccess array. | |
onFailure | Array | Returns empty array when method fails. |
onSuccess array
Parameters
Name | Data type | Description | Notes |
type | String | Type of database that the integration searches for contacts. | Value: external. |
name | String | Name of the contact to search for and return from the external CRM. | |
phone | Array of objects | See phone array. | |
attributes | Object | Key-value pairs of custom attributes and strings that identify the information to be sent with the interaction. |
phone array
Parameters
Name | Data type | Description | Notes |
number | String | Phone number that the integration searches for and returns from the external CRM. | |
label | String | Type of phone number that the integration searches for and returns from the external CRM. |
Example
In this example, when a user searches name or phone numbers before making a call or transferring an interaction, the integration returns the contact Weather Line with the cell phone 3172222222 from an external CRM and screen pops a webpage.
contactSearch: function (searchValue, onSuccess, onFailure) {
// Search the external CRM system and return results in the following format
onSuccess ([{
type: "external",
name: "Weather Line",
phone: [{
number: "(317) 222-2222",
label: "Cell"
}],
attributes: {example_urlpop: "url"}
}]);
}