Hello,
As far as I know (I haven't practiced transcript search often I must say), you would have 2 different API endpoints to search voice transcripts (or transcripts in general).
There is one API endpoint that you can use to filter per topic, and a second API endpoint that you can use to filter per sentimentScore value/range.
At this time, there is no API endpoint which allows to include both filters using the same API endpoint (I mean using topicId and sentimentScore in the same endpoint filters).
1 - Per Topic ID
If you are trying to retrieve conversations which were categorized with a specific topic, you can use POST /api/v2/analytics/transcripts/aggregates/query. It is similar to what I described in this other post.
You could just add the conversationId in groupBy (to retrieve the conversationId of the conversations with this topic).
Ex:
{
"interval": "2021-07-07T22:00:00.000Z/2021-07-08T22:00:00.000Z",
"groupBy": ["mediaType","conversationId"],
"metrics": ["nTopicCommunications"],
"flattenMultivaluedDimensions": false,
"filter": {
"type": "and",
"predicates": [
{
"dimension": "resultsBy",
"value": "communication"
},
{
"dimension": "topicId",
"value": "THE_TOPICID_YOU_ARE_SEARCHING_FOR"
}
]
}
}
With Python SDK, this would correspond to post_analytics_transcripts_aggregates_query
2 - Per SentimentScore
If you are trying to retrieve conversations with a specific sentimentScore (or range), you could use POST /api/v2/speechandtextanalytics/transcripts/search.
There is an example of search with sentimentScore range on this page.
With Python SDK, this would correspond to post_speechandtextanalytics_transcripts_search
3 - Retrieving SentimentScore and Topics
Once you have the conversationIds (as results of one of the search above):
You will get access to the sentimentScore (and some metrics) using GET /api/v2/speechandtextanalytics/conversations/{conversationId}.
See here for more info.
If you need to access the list of topics for a conversation, you have to use GET /api/v2/speechandtextanalytics/conversations/{conversationId}/communications/{communicationId}/transcripturl and download the transcript itself via the obtained downloadUrl.
See here for more info.
The communicationId corresponds to the id of the call/chat/... of the first participant (customer) that appears in the conversation context (obtained via GET /api/v2/conversations/{conversationId}). See this other post for more details.
Regards,