Generate Post Call Survey Detailed Reports Survey Report Using 8x8 Contact Center Historical Analytics Detailed Report API

Updated: 07/25/2024

Objective

Generate Post Call Survey results Detailed Reports Survey report using the 8x8 Contact Center Historical Analytics Detailed Report API.

Applies To

  • 8x8 Analytics for Contact Center API v7
  • Post Call Survey

Procedure

Note for EU Region: Different regions will use different base URLs to https://api.8x8.com/eu, which is used in the examples in this article.

Create an API Key for Analytics for Contact Center

  1. Log in to 8x8 Admin Console.
  2. Select API Keys.
  3. Select Create App.
  4. Enter a name for the app.
  5. For API Products, select Analytics for Contact Center.
  6. Select Save.

Generate an Access Token Using OAuth Authentication

  1. Request an access token from the 8x8 Authorization Server using Basic Authorization with your key and secret as the username and password, respectively.
  2. Combine and then encode your client credentials as a Base64 string.
  3. Make a POST request to the 8x8 Authorization Server using your encoded credentials string in the Authorization header.
  4. Obtain your access token from the response.

Create Report

  1. Call the create report endpoint to generate a report.
  2. Obtain the report ID from the response body.
For example, to generate a "detailed-reports-survey" report for the Post Call Survey script ID 181 for the 22nd of July 2024 for a fictional tenant named myTenantName01.
POST https://api.8x8.com/eu/analytics/cc/v7/historical-metrics/
Authorization: Bearer accessToken
Request Headers: X-Tenant-Info: myTenantName01
Body raw (json):
{
    "dateRange": {
        "start": "2024-07-22T00:00:00.000Z",
        "end": "2024-07-23T00:00:00.000Z"
    },
    "timezone": "Europe/London",
    "title": "Post Call Survey Detailed Report Example",
    "type": "detailed-reports-survey",
    "searchQuery": [
        {
            "field": "surveyId",
            "operator": "in",
            "value": [
                "181"
            ]
        }
    ]
}
Response Status 200 OK
Response Body:
{
    "id": 5064532,
    "status": "DONE"
}

Get the Report Data

  1. Call the get report data endpoint.
  2. Call the subsequent pages of data if applicable.
GET https://api.8x8.com/eu/analytics/cc/v7/historical-metrics/detailed-reports/{{reportId}}/data
  • Authorization Bearer Token
  • Request Headers
    • X-Tenant-Info
  • Query Params
    • size: 100
      • The default number of records to return in each page is 100, with a maximum of 1000
    • lastDocumentId
      • When requesting the first page the lastDocumentId MUST BE OMMITTED
      • When requesting subsequent pages, use the returned value of the Last-Document-Id header as the lastDocumentId of the following request. The Last-Document-Id will change on each request.

Additional Information

Additional information can be found on the 8x8 Developer  Hub.