Website | Documentation | Blog
ElevateAI provides an API for Speech-to-text (ASR), behavioral analysis and sentiment analysis of voice interactions.
- Signup and retrieve API token from ElevateAI.
- Declare an interaction. Provide a URI if you want ElevateAI to download the interaction via a Public URI.
- Retrieve Interaction ID from JSON response and store.
- Upload a file.
- Check status every 30 seconds using Interaction ID until status returns 'processed' or an error status.
- Retrieve results - phrase-by-phrase transcript, punctuated transcript, and AI results.
using ElevateAI.SDK;
using ElevateAI.SDK.Responses;
string token = "API-TOKEN";
string baseUrl = @"https://api.elevateai.com/v1/";
string langaugeTag = "en-us";
string vert = "default";
string transcriptionMode = "highAccuracy";
string localFilePath = @"\\my\localfile.wav";
//Step 1,2
var delcareResponse = ElevateAISDK.DeclareAudioInteraction(langaugeTag, vert, transcriptionMode, token, true, null, baseUrl);
//Step 3
var uploadResponse = ElevateAISDK.UploadFile(delcareResponse.InteractionIdentifier.Value.ToString(), token, localFilePath, baseUrl);
//Step 4
//Loop over status until processed
InteractionStatusResponse status = null;
while (true)
{
status = ElevateAISDK.GetInteractionStatus(delcareResponse.InteractionIdentifier.Value.ToString(), token, baseUrl);
if (status.InteractionStatus.status == "processed" || status.InteractionStatus.status == "fileUploadFailed" || status.InteractionStatus.status == "fileDownloadFailed" || status.InteractionStatus.status == "processingFailed")
{
break;
}
Thread.Sleep(30000);
}
//step 5
//get results after file is processed
var puncTranscript = ElevateAISDK.GetInteractionPunctuatedTranscript(delcareResponse.InteractionIdentifier.Value.ToString(), token, baseUrl);
var wordByWordTranscript = ElevateAISDK.GetInteractionWordByWordTranscript(delcareResponse.InteractionIdentifier.Value.ToString(), token, baseUrl);
var aiResults = ElevateAISDK.GetAIResults(delcareResponse.InteractionIdentifier.Value.ToString(), token, baseUrl);