Submit an Interaction
Declare a Transcript
5 min
// // overview the first step in processing any interaction is to declare the interaction when the post 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 { "interactionidentifier" "46985457 fa6b 4071 a3f6 5c4858160ec9" } it is important you store the interactionidentifier since it will serve as a required parameter for all other elevateai endpoints – and will enable you to post post , get get , and/or delete 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 , regardless of the file upload status or processing outcome only interactions successfully processed are eligible for billing > once declared, you can confirm the processing status processing status of your interaction, as well as tracking impacts to both usage https //docs elevateai com/tutorials/elevateai dashboards#h1qyd and spend https //docs elevateai com/tutorials/elevateai dashboards#jysvi // // request parameters & code examples details on language support for cx ai features can be found on the cx ai feature overview page cx ai feature overview page tab examples url https api elevateai com v1 interactions name declare an interaction for processing transcript method post request pathparameters queryparameters headerparameters kind required name x api token type string description valid api key associated with your account for authentication and usage tracking kind required name content type type string description will be application json bodydataparameters kind required name type type string description type of interaction to be processed will be n transcript kind required name languagetag type string description primary language of transcript will be n en us for north american english n en for international english or n es 419 for north american spanish kind required name vertical type string description vertical associated with interaction will be n default kind required name transcript type object description transcript text to be analyzed see below formdataparameters results languages id ikvdsxifeiysauk1uae r code n interactionidentifier string n language 201 customlabel id ogn fhk6dtgaeyiv7jai code n errormessage string n language 400 customlabel id x6cj5u7giqecvl 2yh9jn code r n errormessage string r n language 401 customlabel id oa5jretm7 0dbef uj2ue code r n errormessage string r n language 429 customlabel selectedlanguageid ikvdsxifeiysauk1uae r examples languages id bqml6kszefmaixjsinhi8 code curl location request post https api elevateai com v1 interactions n header content type application json n header x api token your api token n data raw n type transcript n languagetag en us n vertical default n transcript n allparticipants n phrases n word a n word b n n phrasesegments n n starttimeoffset starta n endtimeoffset enda n phraseindex 0 n score 1 n n n starttimeoffset startb n endtimeoffset endb n phraseindex 1 n score 1 n n n n participantone n phrases n word a n n phrasesegments n n starttimeoffset starta n endtimeoffset enda n phraseindex 0 n score 1 n n n n participanttwo n phrases n word b n n phrasesegments n n starttimeoffset startb n endtimeoffset endb n phraseindex 0 n score 1 n n n n n language curl customlabel id x ebrhmertyeep47yobtg code var request require request ; nvar options n method post n url https api elevateai com v1 interactions n headers n content type application json n x api token your api token n n body r n type transcript r n languagetag en us r n vertical default r n transcript r n allparticipants r n phrases r n word a r n word b r n r n phrasesegments r n r n starttimeoffset start ms a r n endtimeoffset end ms a r n phraseindex 0 r n score 1 r n r n r n starttimeoffset start ms b r n endtimeoffset end ms b r n phraseindex 1 r n score 1 r n r n r n r n participantone r n phrases r n word a r n r n phrasesegments r n r n starttimeoffset start ms a r n endtimeoffset end ms a r n phraseindex 0 r n score 1 r n r n r n r n participanttwo r n phrases r n word b r n r n phrasesegments r n r n starttimeoffset start ms b r n endtimeoffset end ms b r n phraseindex 0 r n score 1 r n r n r n r n r n n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel id tsr8ubyzm5givtxz3e4i2 code var myheaders new headers ; nmyheaders append content type application json ; nmyheaders append x api token your api token ; n nvar raw r n type transcript r n languagetag en us r n vertical default r n transcript r n allparticipants r n phrases r n word a r n wordb r n r n phrasesegments r n r n starttimeoffset startmsa r n endtimeoffset endmsa r n phraseindex 0 r n score 1 r n r n r n starttimeoffset start ms b r n r n endtimeoffset end ms b r n r n phraseindex 1 r n score 1 r n r n r n r n participantone r n phrases r n word a r n r n phrasesegments r n r n starttimeoffset start ms a r n r n endtimeoffset end ms a r n r n phraseindex 0 r n score 1 r n r n r n r n participanttwo r n phrases r n word b r n r n phrasesegments r n r n starttimeoffset start ms b r n r n endtimeoffset end ms b r n r n phraseindex 0 r n score 1 r n r n r n r n r n ; n nvar requestoptions n method post n headers myheaders n body raw n redirect follow n ; n nfetch https api elevateai com v1 interactions requestoptions n then response response text n then result console log result n catch error console log error error ; language javascript customlabel id dzn83h91blzhvwk1la46l code import requests nimport json n nurl https api elevateai com v1 interactions n npayload r n type transcript r n languagetag en us r n vertical default r n transcript r n allparticipants r n phrases r n word a r n wordb r n r n phrasesegments r n r n starttimeoffset startmsa r n endtimeoffset endmsa r n phraseindex 0 r n score 1 r n r n r n starttimeoffset start ms b r n r n endtimeoffset end ms b r n r n phraseindex 1 r n score 1 r n r n r n r n participantone r n phrases r n word a r n r n phrasesegments r n r n starttimeoffset start ms a r n r n endtimeoffset end ms a r n r n phraseindex 0 r n score 1 r n r n r n r n participanttwo r n phrases r n word b r n r n phrasesegments r n r n starttimeoffset start ms b r n r n endtimeoffset end ms b r n r n phraseindex 0 r n score 1 r n r n r n r n r n nheaders n content type application json n x api token your api token n n nresponse requests request post url headers headers data payload n nprint response text n language python customlabel selectedlanguageid bqml6kszefmaixjsinhi8 description currentnewparameter label body parameter value bodydataparameters // // formatting a transcript for processing transcript files will be formatted according to the schema below, and included as a body parameter when declaring the transcript for processing sample transcription format sample transcription format { "allparticipants" { "phrases" \[ "i", "hope", "this", "documentation", "was", "useful", "thank", "you", ] "phrasesegments" \[ { "starttimeoffset" 870, "endtimeoffset" 1330, "phraseindex" 0, "score" 1 } ] }, "participantone" { "phrases" \[ "i","hope","this","documentation","was","useful", ] }, } schema element type description {participant} object top level for speaker label , will be " allparticipants ", or " participantone " and/or " participanttwo " {participant}/ phrases array of strings ordered list of each unique phase spoken by {participant} in the interaction {participant}/ phrasesegments array of objects list of details associated with each phrase in transcript for the {participant} {participant}/phrasesegments/ starttimeoffset number start time of phrase (in milliseconds) {participant}/phrasesegments/ endtimeoffset number end time of phrase (in milliseconds) {participant}/phrasesegments/ phraseindex number index of phrase in {participant}/phrases {participant}/phrasesegments/ score float confidence score, if not available should be 1 pro tip allparticpants is a required object when providing a transcript for analysis while participantone and participanttwo objects are not required, they are highly recommended