Submit an Interaction

Declare a Chat Interaction

// Overview

The first step in processing any interaction 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.

Sample API Response


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 in troubleshooting.

All interactions successfully declared will count towards your monthly request quota, irrespective of file upload status or processing outcome.



Only interactions successfully processed are eligible for billing. Once declared, you are able to confirm the processing status of the interaction as well as track impacts to usage and spend.



// Request Parameters & Code Samples

Details on CX AI features supported by language can be found on the overview page.

POST
Request
Header Parameters
X-API-Token
required
String
Valid API key associated with your account for authentication and usage tracking
Content-Type
required
String
Will be 'application/JSON'
Body Parameters
type
required
String
Type of interaction to be processed, will be "chat"
languageTag
required
String
Primary language of the chat, will be "en-us" (for North American English), "en" (for International English), or "es-419" (for North American Spanish)
vertical
required
String
Vertical associated with interaction, will be "default"
chat
required
Object
Formatted chat text (see below)
Curl
Node.js
JS
Python
Ruby
Responses
201
400
401
429



// 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.

Sample Chat Format




Element

Type

Description

participants

array of objects

Ordered list of details associated with each participant, will include 1+ objects

participant/participant_id

string

Unique identifier associated with participant

participants/name

string

Name of participant

participants/role

string or null

Will be agent or customer

messages

array of objects

Ordered list of details associated with each chat message, will include 1+ objects

messages/participant_id

string

Maps to a unique participant_id within participants object

messages/timestamp

string

Date/time that the chat message was sent, formatted according to ISO 8601 (UTC)

messages/content

string

Chat message