Speech Analytics API returning truncated transcript for long calls

The transcript coming back from the Speech and Text Analytics API is cutting off halfway through. We are hitting GET /api/v2/analytics/speech/queries with a valid token. The response has 200 OK but the text ends abruptly at the 45-minute mark for a 60-minute call.

Here is the snippet:
var query = new SpeechQuery { ConversationId = “id123” };
var result = client.AnalyticsApi.PostSpeechQueryAsync(query).Result;

Is there a pagination token I am missing in the JSON payload? The docs don’t mention it clearly.

You’re using .Result. That’s a deadlock waiting to happen, especially in ASP.NET Core or Azure Functions. The task won’t complete, or it will timeout and truncate the stream. But more importantly, the Speech Analytics API doesn’t return the full transcript in one shot for long conversations. It chunks it.

The docs for PostSpeechQuery are a bit vague on the size parameter limits. The default is usually 200 records, but for transcript lines, you’ll hit a wall. You need to use the nextPageToken in the response.

Here is how you actually fetch the whole thing in .NET without hanging:

var client = platformClient.AuthClient.GetApplication().GetPlatformClient();
var analyticsApi = client.AnalyticsApi;

var query = new SpeechQuery 
{ 
 ConversationId = "id123",
 Size = 500 // Max allowed per page usually
};

var allTranscriptLines = new List<SpeechResult>();

var response = await analyticsApi.PostSpeechQueryAsync(query);

allTranscriptLines.AddRange(response.Entities);

while (!string.IsNullOrEmpty(response.NextPageToken))
{
 query.NextPageToken = response.NextPageToken;
 response = await analyticsApi.PostSpeechQueryAsync(query);
 if (response.Entities != null)
 {
 allTranscriptLines.AddRange(response.Entities);
 }
}

// Now join them
var fullTranscript = string.Join("\n", allTranscriptLines.Select(x => x.Text));

Also check if you have a timeout set on your HttpClient. If the call is 60 minutes, the API might be taking a while to assemble that query. Increase the timeout.