Skip to main content

Uniphore Help Center Portal

Fetch Sentiments by ID

Sentiments API retrieves the sentiment of a given conversation ID.

Endpoint

Method: GET

URL: https://api.<region>.cloud.uniphore.com/data-collector/sentiments/{conversationId}

Request
curl -H “Authorization: Bearer 911999706310ffbcb32981863e23ce72d5e60d7b” -XGET https://api.<region>.cloud.uniphore.com/data-collector/sentiments/{conversationId}?tenantId=<tenantID>&environment=<environment>
Header Parameter
Authorization - Bearer <Token>
Path Parameters

Parameter Name

Mandatory/

Optional

Type

Description

conversationId

Mandatory

string

Id of the conversation whose sentiment needs to be fetched

Query Parameters

Parameter Name

Mandatory / Optional

Data Type

Description

tenantid

Mandatory

String

The unique identifier for your account.

environment

Optional

String

Operating environment type. Three out-of-the-box environments are provided for each account:

  • DEV

  • TEST

  • PROD

Example Response
{
  "_id": "5efcc89e2efc67ea7de09b71",
  "conversationId": "57931",
  "startTime": 1593161838000,
  "isChunk": false,
  "turns": [
    {
      "order": 1,
      "speaker": "Agent",
      "sentiment": {
        "value": "NEUTRAL",
        "confidence": 0.52
      }
    },
    {
      "order": 2,
      "speaker": "Customer",
      "sentiment": {
        "value": "NEUTRAL",
        "confidence": 0.85
      }
    },
    {
      "order": 3,
      "speaker": "Agent",
      "sentiment": {
        "value": "NEUTRAL",
        "confidence": 0.92
      }
    },
    {
      "order": 4,
      "speaker": "Customer",
      "sentiment": {
        "value": "POSITIVE",
        "confidence": 0.77
      }
    }
  ],
  "overall": {
    "sentiment": {
      "agentSentiment": "NEUTRAL",
      "customerSentiment": "POSITIVE"
    }
  },
  "metadata": {
    "agentId": "353",
    "organizationId": "2",
    "tenantId": "1",
    "customerId": "205",
    "conversationId": "cc1adf1d-4d01-4968-9168-529a5767041e",
    "businessProcessId": "13",
    "type": "batch",
    "conversationType": "voice",
    "convId": "PreethiNTEStereo0001",
    "isDiarized": true,
    "contactDuration": 486987
  },
  "__ts": 1584151104000
}
Response and Error Codes

Code

Response

200

OK – The request was successful

401

{“reason”:”Authentication failed”}

404

Record Not Found

500

{“error”: “Internal server error”}