Fetch Sentiments based on a query
sentiments [ id-range ] API fetches the list of sentiments based on the Ids passed. This is a streaming API.
Endpoint
Method: GET
URL: https://api.<region>.cloud.uniphore.com/data-collector/sentiments?t=id-range&ids=id1,id2,…idn&tenantid=<tenant_id>&environment=<env_name>
Request
curl -H “Authorization: Bearer 911999706310ffbcb32981863e23ce72d5e60d7b” -XGET https://api.<region>.cloud.uniphore.com/data-collector/sentiments?t=id-range&ids=1,2,3,...,n&tenantId=<tenantId>&environment=<environment>
Header Parameter
Authorization - Bearer <Token>
Query Parameters
Parameters Name | Mandatory/ Optional | Type | Description |
---|---|---|---|
| Mandatory | string | t represents the type of query. Example: For ids use id-range value. |
| Mandatory | string | A list of ids for which sentiments need to be fetched. The ids are separated by a comma. |
| Mandatory | String | The unique identifier for your account. |
| Optional | String | Operating environment type. Three out-of-the-box environments are provided for each account:
|
Response and Error Codes
Code | Response |
---|---|
200 | A stream of newline separated sentiment documents in the format listed in the above API |
401 | {“reason”:”Authentication failed”} |
422 | {“error”: “Error while decoding response from the database”} |
500 | {“error”: “Internal server error”} |
Sentiment Schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "NLP Output", "description": "Real Time NLP Output", "type": "object", "definitions": { "turn": { "type": "object", "properties": { "order": { "type": "integer" }, "speaker": { "type": "string" }, "entities": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" }, "nerLabel": { "type": "string" }, "uri": { "type": "string" }, "confidence": { "type": "number" }, "startChar": { "type": "integer" }, "endChar": { "type": "integer" }, "startOffset": { "type": "integer" }, "endOffset": { "type": "integer" } }, "required": [ "text", "nerLabel", "confidence", "startChar", "endChar" ] } }, "sentiment": { "type": "object", "properties": { "value": { "type": "string" }, "confidence": { "type": "number" } }, "required": [ "value", "confidence" ] } }, "required": [ "order", "speaker" ] }, "overall": { "type": "object", "properties": { "sentiment": { "type": "object", "properties": { "contactSentiment": { "type": "string" }, "customerSentiment": { "type": "string" }, "agentSentiment": { "type": "string" } }, "required": [ "contactSentiment", "customerSentiment", "agentSentiment" ] } } }, "metaData": { "description": "contact level meta data.", "type": "object", "properties": { "agentId": { "description": "Agent identifier of a transcript.", "type": "string" }, "customerId": { "description": "customer identifier of a transcript.", "type": "string" }, "conversationId": { "description": "Contact identifier of a transcript assinged by platform.", "type": "string" }, "clientContactId": { "description": "Client contact identifier of a transcript.", "type": "string" }, "journeyId": { "description": "Journey identifier of a transcript.", "type": "string" }, "conversationType": { "description": "Conversation type of a transcript (voice, chat, email).", "type": "string" }, "contactDuration": { "description": "Contact duration of a transcript", "type": "integer" }, "audioType": { "description": "Audio type of voice contact (stereo, mono).", "type": "string" }, "isDiarized": { "description": "True if the audio is diarized, false otherwise", "type": "boolean" }, "tenantId": { "description": "Tenant identifier of a transcript.", "type": "string" }, "organizationId": { "description": "organization identifier of a transcript.", "type": "string" }, "businessProcessId": { "description": "Business Process identifier of a transcript.", "type": "string" }, "type": { "description": "Type of a transcript (live or batch).", "type": "string" } }, "required": [ "agentId", "customerId", "clientContactId", "conversationType", "contactDuration", "tenantId", "organizationId", "businessProcessId", "type" ] } }, "properties": { "conversationId": { "type": "string" }, "startTime": { "type": "integer" }, "isChunk": { "type": "boolean" }, "turns": { "type": "array", "items": { "$ref": "#/definitions/turn" } }, "overall": { "$ref": "#/definitions/overall" } }, "required": [ "conversationId", "startTime", "turns", "overall" ] }