The Reporting API lets you get the Interaction logs from the Staging and Production environments. Interactions that are initiated on the Staging environment are always logged with session mode 'Test'. Interactions initiated on the Production environment are logged as is.
Note that data can only be retrieved from the last 90 days.
Prerequisites:
- Reporting API Credentials (if you don’t have these you can request them at support)
- Postman
Steps
1 - Open Postman
2 - Create a new request
3 - In the Params tab, enter the dates that you want to pull for the report and enter the API key. You can use the following URL in the GET field and update the highlighted values with the info you need for the project.
https://reportingapi.digitalcx.com/CUSTOMER/projects/CUSTOMERPROJECT/interactions?culture=nl&end=16-12-2022&begin=15-12-2022&apikey=xxxxxxxxxxxxxxxxxxxxxxxxx
(The CUSTOMER and CUSTOMERPROJECT values can be seen in the URL of your project. For example, https://login.digitalcx.com/#CUSTOMER/CUSTOMERPROJECT/en/tasks)
4 - Next, we need to get the Access Token. Get the access token via a POST request:
Import the following request in Postman (click on the Import button and paste the code below as Raw text:
curl --location --request POST 'https://login.microsoftonline.com/digitalcx.onmicrosoft.com/oauth2/token'
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: fpc=AodvfYNUotZAqiiwmJpLVYYl99xNAQAAAKSQYNsOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=client_id' \
--data-urlencode 'client_secret=client_secret' \
--data-urlencode 'resource=https://digitalcx.onmicrosoft.com/external-api'
Make sure to fill in the client_id and client_secret in the Body and press "Send". In the response you will get the access token that you need to use for your request to the Reporting API. Copy this access token.
Switch back to your Reporting API GET request. On the Authorization tab, Select Type > OAuth 2.0 and paste the copied access token as shown in below screenshot:
5 - Click the Send button and select "Send and Download" and save the file as .csv
6 - Now that you have your downloaded report, you can open it in excel. Open a blank workbook and select the Data tab and select "From Text/CSV" option and import the file.
7 - Select Load and the data will load into the worksheet