The API direct access point (DAP) for chat lets you automatically route incoming chat sessions to a queue based on a response from an external API endpoint that you configure. This eliminates the need for end-users to select from a queue menu. The endpoint can be your own or that of a third-party service.
With this capability enabled, when an end-user starts a chat, CCAI Platform sends a request to your API endpoint. The API returns routing data (key-value pairs), which CCAI Platform uses to match the end-user to the correct queue. If no match is found, the standard queue menu appears as a fallback.
The API DAP works for the following:
Web and mobile chats
New and resumed chats
Before you begin
By default, this capability is inactive. Contact Google Cloud Support to turn it on for your instance.
DAP types
There are two DAP types: API response and webhook response. Each DAP type has a different workflow.
API response
Here's the API response workflow:
An end-user starts a new or resumed chat.
Before the queue menu appears, CCAI Platform sends a request to your API endpoint, including any parameters you have defined, such as session metadata or custom data.
The API returns one or more key-value pairs.
CCAI Platform matches these pairs with the key-value pairs configured on your chat queues. All pairs must match for the chat to be routed to a queue.
If a match is found, the end-user is routed directly to that queue.
The standard queue menu appears if either of the following occurs:
No match is found.
The API doesn't respond within the configured API request timeout.
Webhook response
Here's the webhook response workflow:
An end-user starts a new or resumed chat.
Before the queue menu appears, CCAI Platform sends a request to your API endpoint, including a webhook URL.
The API returns an acknowledgment response (HTTP 200) within the API request timeout.
Your system processes the request and sends routing data (key-value pairs) to CCAI Platform using the webhook.
CCAI Platform matches these pairs with the key-value pairs configured on your chat queues. All pairs must match for the chat to be routed to a queue.
If a match is found, the end-user is routed directly to that queue.
The standard queue menu appears if any of the following occurs:
No match is found.
The acknowledgment isn't received within the API request timeout.
The webhook response isn't received within the API callback timeout.
Configure an API DAP for chat globally
To configure an API DAP for chat globally, follow these steps:
In the CCAI Platform portal, click Settings > Developer Settings. If you don't see the Settings menu, click Menu.
Go to the API Request Direct Access Point pane, and then click Manage API Request Direct Access Point.
Click the Chat tab.
Click the API Request Direct Access Point for Chat toggle to the on position.
For Direct Access Point Type, select one of the following DAP types:
API Response: The API returns routing data in its response.
Webhook Response: The API acknowledges the request, then sends routing data to a webhook.
To specify which chat types trigger the API DAP, for Chat Types, select one or both of the following:
New chats
Resumed chats
In the API Request field, enter the API endpoint URL to use for the DAP.
To configure authentication, do one of the following:
To configure basic authentication, do the following:
For Authentication Method, select Basic Authentication.
For Authentication Credentials, enter your username and password.
To configure a custom header, do the following:
For Authentication Method, select Custom Header.
Click Add field. The Add Field dialog appears.
Enter a field key and field value, and then click Save.
To configure the API request timeout, do the following:
For API Request Timeout, set the number of seconds that CCAI Platform waits for the API to respond before timing out.
Optional (appears only if you selected the Webhook Response DAP type): For API Callback Timeout, set the number of seconds that CCAI Platform waits for routing data from the webhook (after the initial acknowledgment) before timing out.
To set the request method, for API Request Method, select POST or GET.
To configure a data parameter, do the following:
Click the Pass Data Parameters toggle to the on position.
Click Add Parameter. The Add Parameter dialog appears.
Do one of the following:
To configure a fixed data parameter, do the following:
In the Type list, click Fixed.
In the Destination Field field, enter the destination key.
In the Destination Value field, enter the destination value. A preview of your data parameter appears in the Preview field.
To configure a dynamic data parameter, do the following:
In the Type list, click Dynamic.
Do one of the following:
To configure session metadata, do the following:
In the Source list, select Session Metadata.
In the Incoming Field list, select a metadata type.
To configure signed custom data, do the following:
In the Source list, select Signed Custom Data.
In the Incoming Field list, enter the incoming field.
To configure unsigned custom data, do the following:
In the Source list, select Unsigned Custom Data.
In the Incoming Field list, enter the incoming field.
In the Destination Field field, enter the destination field. A preview of your data parameter appears in the Preview field.
Click Add Parameter. Your data parameter appears in the Data Parameters list.
Optional: To test your configuration, do the following:
Go to the Test Connection section. Your data parameters appear in the list.
Optional: To try different parameter values, edit the parameters values in the list.
Click Test this connection.
Click Save Chat API.
Change the routing logic
Routing logic is the order in which CCAI Platform tries various matching types to match a chat to a queue. CCAI Platform evaluates each matching type in order and routes the chat to the first matching queue. If no match is found, the standard queue menu appears.
Here are the three matching types:
API response: Matches based on the API response key-value pairs.
General access point label: Matches based on the queue's general access point label.
User segmentation: Matches based on user segment data.
To change the routing logic, follow these steps:
In the CCAI Platform portal, click Settings > Developer Settings. If you don't see the Settings menu, click Menu.
Go to the API Request Direct Access Point pane, and then click Manage API Request Direct Access Point.
Click the Chat tab.
For Routing Logic, hold the pointer over a matching type and drag it to a new position.
Repeat this step if needed.
Click Save Chat API.
Configure a DAP for chat at the queue level
To configure a DAP for chat at the queue level, follow these steps:
In the CCAI Platform portal, click Settings > Queue. If you don't see the Settings menu, click Menu. The Queue Menu Settings page appears.
Depending on the channel that you want, do one of the following:
In the Mobile pane, click Edit / View.
In the Web pane, click Edit / View.
Click the queue that you want to edit.
In the Settings pane, go to the Access Point section.
Click Create direct access point. The Create Direct Access Point dialog appears.
In the Access Point Type list, click API Response.
In the Access Point Name field, enter an access point name.
Click Add Key & Value. Enter a key-value pair to match with a key-value pair returned in the API response.
Repeat the previous step to add more key-value pairs.
Optional: In the Greeting Message field, enter the greeting message that you want to use when an end-user is directed to this menu option.
Click Create. Your DAP appears in the Access Point list.