Through the Zammo Analytics API, you can get sentiment information about not only user utterances but also how your chatbot is responding.

We’ll be using the get analytics-export/export-conversations-with-sentiment API endpoint for this.

If you haven’t already, read and familiarize yourself with Using The Analytics API, which covers obtaining an API key and creating a request through the Zammo Public API Documentation and Test page. Follow Step 1 - Find Your API Key and Step 2 - Create a Request: Authorization on that page before continuing with the instructions here.

Creating a Request: Exporting Conversations with Sentiment

  1. Click the down arrow next to the export-conversations-with-sentiment endpoint. The endpoint panel will expand.
  2. Click Try it out. The start, end, and version input fields become active.
  3. Enter the start time and end time of the period you want to get sentiment data for. Your screen should look like this:

Untitled

<aside> 💡 The start and end date fields are generally supplied in UTC format. For example, a start date of 2021-10-01T18:41:00 equates to October 1st, 2021 18:41:00. You can specify a time offset to reflect your time zone, for example 2021-10-01T00:00:00.000-8:00 for Pacific Standard Time, however, the analytics response will be in UTC and will need to be converted for analysis. If you do not specify a time offset, UTC will be assumed.

</aside>

  1. Click Execute. The page will connect to the API and return a response. Once that happens, as with the analytics endpoint, the Curl and Request URL fields will be populated with the information you need to replicate this request in your preferred data analysis environment. The Server response area will be populated with the result Code and the Details of the response.

The server response takes the following format:

{
  "pageNumber": 1,
  "pageSize": 551,
  "totalPages": 1,
  "totalRecords": 551,
  "finalPage": "<https://app.zammo.ai/api/v0.0/analytics-export/export-conversations-with-sentiment-page?businessId=8060c138-3f65-4771-8567-2a4f728abed6&start=2022-11-15T00%3a00%3a00.0000000%2b00%3a00&end=2022-11-16T00%3a00%3a00.0000000%2b00%3a00&pageNumber=1&totalRecords=551>",
  "nextPage": null,
  "previousPage": "<https://app.zammo.ai/api/v0.0/analytics-export/export-conversations-with-sentiment-page?businessId=8060c138-3f65-4771-8567-2a4f728abed6&start=2022-11-15T00%3a00%3a00.0000000%2b00%3a00&end=2022-11-16T00%3a00%3a00.0000000%2b00%3a00&pageNumber=1&totalRecords=551>",
  "data": [
    {
      "conversationId": "JZPVS0ue9ZCAvQ6jnE6Cn3-us",
      "sentenceId": "2ce45ed3-a073-4e67-c453-08dac711d5b0",
      "text": "launch. ",
      "userType": "User",
      "keywords": null,
      "sentiment": "Neutral",
      "positiveScore": 0.01,
      "negativeScore": 0,
      "neutralScore": 0.98
    }
  ]
}

Metadata

Key Description of value
pageNumber The current page number of the results. Used in pagination.
pageSize The number of entries on the page. For single-page responses, this is the total number of records returned.
totalPages The number of pages in the response. *totalRecords *****divided by ****pageSize, rounded up.
totalRecords The total number of records in the overall query.
finalPage,
nextPage,
previousPage URLS with parameters already populated to fetch the next, previous, and last pages of the results in your API query.

Data

Key Description of value
conversationId The Conversation ID associated with the utterance. This correlates to the Conversation ID in the Analytics Export.
sentenceId The unique Sentence ID associated with the utterance.
text The utterance.
userType Either User or Bot depending on the origin of the utterance.
keywords When calculating sentiment, the AI may identify key words that helped influence its decision. These keywords are listed here.
sentiment The overall sentiment of the utterance, Positive, Negative, or Neutral.
positiveScore
negativeScore
neutralScore The scores associated with the sentiments after the AI performs its analysis of the utterance. Useful in seeing if, for example, Neutral utterances lean Positive or Negative. NOTE: The highest-scored sentiment is not always the overall sentiment.

Some suggested actions