Declare a Chat Interaction
// Overview
The first step in processing any chat file is to declare the interaction.
When the POST request successfully executes, an HTTP status is returned to indicate the request was successful, along with a JSON response containing the interactionIdentifier:
{
"interactionIdentifier": "6091d697-9a98-4953-9850-d3e9b82cd5ab"
} It is important you store the interactionIdentifier as it will serve as a required parameter for all other ElevateAI endpoints – enabling you to POST, GET, and/or DELETE information associated with this interaction.
If an error occurs when requesting to declare the interaction, a standard HTTP response code is retuned to indicate the request was unsuccessful, along with a JSON response containing additional details to assist with troubleshooting.
All interactions successfully declared will count towards your monthly request quota, regardless of the file upload status or processing outcome.
Only interactions that have successfully processed are eligible for billing.
--> Once declared, you can check the processing statusconfirm the processing status of your interaction, as well as tracking impacts to both usage and spend.
// Request Parameters & Code Samples
Details on language support for CX AI features can be found on the CX AI Feature OverviewCX AI Feature Overview page.
var myHeaders = new Headers();
myHeaders.append("X-API-Token", "string");
myHeaders.append("Content-Type", "string");
var raw = "{\"type\":\"String\",\"languageTag\":\"String\",\"vertical\":\"String\",\"chat\":\"Object\"}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.elevateai.com/v1/interactions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));// Formatting a Chat for Processing
Chat files will be formatted according to the schema below and included as a body parameter when declaring a chat interaction for processing.
Need more help? Contact the ElevateAI Support team.