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
- Log in to 8x8 Admin Console.
- Select API Keys.
- Select Create App.
- Enter a name for the app.
- For API Products, select Analytics for Contact Center.
- Select Save.
Generate an Access Token Using OAuth Authentication
- Request an access token from the 8x8 Authorization Server using Basic Authorization with your key and secret as the username and password, respectively.
- Combine and then encode your client credentials as a Base64 string.
- Make a POST request to the 8x8 Authorization Server using your encoded credentials string in the Authorization header.
- Obtain your access token from the response.
Create Report
- Call the create report endpoint to generate a report.
- 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
- Call the get report data endpoint.
- 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.
- size: 100
Additional Information
Additional information can be found on the 8x8 Developer Hub.