This document provides an example integration with Contact Center AI Platform (CCAI Platform) custom CRM using EspoCRM. EspoCRM is a free, open-source CRM application that helps businesses manage sales, marketing, and customer support with a customizable interface. It offers features like contact management, activity tracking, sales automation, and inventory management, with options for self-hosting or cloud deployment.
To set up your own instance of EspoCRM, see the EspoCRM installation page.
Before you begin
Do the following:
Configure your firewall to permit traffic from CCAI Platform.
Create an API user in your EspoCRM instance—for example,
google_integration_user. For more information, see API in the EspoCRM Documentation.Create a role in your EspoCRM instance with the Create, Read, and Update actions that accesses the following:
- Contacts: to find or create callers
- Cases: to search for and log tickets
For more information, see Role Management in the ExpoCRM documentation.
Configure a connection from EspoCRM to CCAI Platform
To configure a connection from EspoCRM to CCAI Platform, follow these steps:
- In the CCAI Platform portal, click Settings > Developer Settings. If you don't see the Settings menu, click Menu.
- For Agent Platform, select Custom CRM.
- Click the Display CRM in CCAI Platform portal Portal toggle to the on position.
- In the Display URL field, enter the URL to embed in the
CCAI Platform portal–for example,
https://YOUR_ESPO_DOMAIN/#Case/view/{RECORD_ID}. - For CRM lookup method, select Generic API.
- To authenticate using a custom header, do the following:
- In the Authentication Method section, select Custom Header.
- Click Add field. The Add Field dialog appears.
- In the Field Key field, enter
X-Api-Key. - In the Field Value field, enter the API key generated when you created an API user in your EspoCRM.
- Click Save.
- In the Field Key field, enter
- To set the CRM lookup URL, do the following:
- In the CRM lookup URL section, in the Record lookup URL field,
enter the URL to look up a record—for example,
https://YOUR_ESPO_DOMAIN/#Case/view/{RECORD_ID}. - In the Account lookup URL field, enter the URL to look up an
account—for example,
https://YOUR_ESPO_DOMAIN/#Contact/view/{ACCOUNT_ID}. - Click Save. ## Configure API endpoints
- In the CRM lookup URL section, in the Record lookup URL field,
enter the URL to look up a record—for example,
Configure endpoints that are compatible with EspoCRM to ensure that your integration has the components for looking up accounts (contacts) and records (cases). For more information about compatible variables, see API Overview in the EspoCRM documentation.
Configure API account endpoints
This section explains how to configure API account endpoints.
Configure a Find an account by query endpoint
To configure the Find an account by query endpoint, follow these steps:
- In the CCAI Platform, click Settings > Developer Settings. If you don't see the Settings menu, click Menu.
- In the CRM pane, go to the API account section.
- For Find an account by query endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Contact. - For Method, select GET.
To configure request parameters, do the following:
- To configure the first request parameter, follow these steps:
- Click Add field. The Add Field dialog appears.
- In the Field Key field, enter
where[0][attribute]. - In the Field Value field, enter
phoneNumber. - Click Save.
To configure the rest of the request parameters, repeat the previous steps using the information in the following table. You've already created the first request parameter.
Field Key Field Value where[0][attribute]phoneNumberwhere[0][type]equalswhere[0][value]{PHONE_NUMBER}sortBycreatedAtascfalse
- To configure the first request parameter, follow these steps:
In the Response Data Location field, enter
data.list.Click Save.
Click Back to Developer Settings to return to the Developer Settings page.
Configure a Find an account by ID endpoint
To configure the Find an account by ID endpoint, follow these steps:
- In the CRM pane, go to the API account section.
- For Find an account by ID endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Contact/{ACCOUNT_ID}.- For Method, select GET.
- Set the Response Data Location to
data. - Click Save.
- Click Return to developer settings to return to the Developer Settings page.
Configure a Create an account endpoint
To configure the Create an account endpoint, follow these steps:
- In the CRM pane, go to the API account section.
- For Create an account endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Contact. - For Method, select POST.
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Field dialog appears.
- In the Field Key field, enter
phoneNumber. - In the Field Value field, enter
{PHONE_NUMBER}. - Click Save.
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value phoneNumber{PHONE_NUMBER}firstNameNew CallerlastName{CALL_ID}nameNew Caller {CALL_ID}
- To configure the first request parameter, follow these steps:
Set the Response data location to
data.Set the Object ID location to
id.Click Save.
Click Return to developer settings to return to the Developer Settings page.
Configure an Update an account endpoint
To configure the Update an account endpoint, follow these steps:
- In the CRM pane, go to the API account section.
- For Update an account endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Contact. - For Method, select PUT.
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Field dialog appears.
- In the Field Key field, enter
contactId. - In the Field Value field, enter
{PHONE_NUMBER}. - Click Save.
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value contactId{PHONE_NUMBER}phoneNumberNew Caller
- To configure the first request parameter, follow these steps:
Set the Response data location to
data.Click Save.
Click Return to developer settings to return to the Developer Settings page.
Configure API record endpoints
This section explains how to configure API record endpoints.
Configure a Find a record by query endpoint
To configure the Find a record by query endpoint, follow these steps:
- In the CRM pane, go to the API record section.
- For Find a record by query endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Case. - For Method, select GET.
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Field dialog appears.
- In the Field Key field, enter
where[0][attribute]. - In the Field Value field, enter
contactId. - Click Save.
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Field Key Field Value where[0][attribute]contactIdwhere[0][type]equalswhere[0][value]{ACCOUNT_ID}contactId{ACCOUNT_ID}sortBycreatedAtascfalse
- To configure the first request parameter, follow these steps:
In the Response Data Location field, enter
data.list.Click Save.
Click Return to developer settings to return to the Developer Settings page.
Configure a Find a record by ID endpoint
Often used in SDK based interactions, this lets you pass a specific record ID to associate the interaction with. To configure the Find a record by ID endpoint, follow these steps:
- In the CRM pane, go to the API record section.
- For Find a record by ID endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Case/{RECORD_ID}. - For Method, select GET.
- In the Response Data Location field, enter
data. - Click Save.
- Click Return to developer settings to return to the Developer Settings page.
Configure a Create a record endpoint
To configure the Create a record endpoint, follow these steps:
- In the CRM pane, go to the API record section.
- For Create a record endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Case. - For Method, select POST.
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Field dialog appears.
- In the Field Key field, enter
description. - In the Field Value field, enter
CALL Session:{CALL_ID}. - Click Save.
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value descriptionCall Session: {CALL_ID}nameInbound Call from {ANI}contactId{ACCOUNT_ID}statusNewcchatId{CHAT_ID}ccallId{CALL_ID}cChannel{CHANNEL}Type{SESSION_TYPE}
- To configure the first request parameter, follow these steps:
In the Response Data Location field, enter
data.In the Object ID Location field, enter
id.Click Save.
Click Return to developer settings to return to the Developer Settings page.
Configure an Update a record endpoint
To configure the Update a record endpoint, follow these steps:
- In the CRM pane, go to the API record section.
- For Update a record endpoint, click Setup. The Generic API Endpoint Setup page appears.
- In the URL field, enter the URL to look up an account–for example,
https://YOUR_ESPO_DOMAIN/api/v1/Case/{RECORD_ID}. - For Method, select PUT.
To configure Request Parameters, do the following:
- To configure the first request parameter, follow these steps:
- For Request Parameters, click Add field. The Add Field dialog appears.
- In the Field Key field, enter
parentId. - In the Field Value field, enter
{RECORD_ID}. - Click Save.
To configure the rest of the request parameters, repeat the previous step, using the information in the following table. You've already created the first request parameter.
Parameter Key Parameter Value parentId{RECORD_ID}parentTypeCasestatusNewdescription{TICKET_DESCRIPTION}
- To configure the first request parameter, follow these steps:
In the Response data location field, enter
data.Click Save.
Click Return to developer settings to return to the Developer Settings page.