Query Analytics via API


All the requests work as jobs, they can be requested then they are in the background generated and can be retrieved after through a download link in CSV format.

The contents of the analytics are explained here: Analytics

Access Token & URL

You can see here how to get an access token and the URL:

How to get a Token for our APIs

About these APIs

Start the job

Each job needs to define a startDate and endDate.

Only in that time interval data will be evaluated.

Chat Interactions:

curl '<HOST OF URL>/analytics/chat-interactions?startDate=2024-05-03&endDate=2024-06-02' \ -X GET \ -H 'content-type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'

Active Users:

curl '<HOST OF URL>/analytics/active-users?startDate=2024-05-03&endDate=2024-06-02' \ -X GET \ -H 'content-type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'

Reference Statistics:

curl '<HOST OF URL>/analytics/reference-stat-export?startDate=2024-05-03&endDate=2024-06-02' \ -X GET \ -H 'content-type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'

Detailed user Interactions:


As response from each request you should get the the ID of the analytics order that you just placed. This Id you now need to check for the status until its finished.

The date range defaults to 1 day when no date parameters are provided.

Waiting on the job to finish

Regularly check if the job is finished. Please leave at least 10 sec between checks to not overtax the system.

 

This is what is returned so you can check the state. You can not fetch the analytics until they are done.

Download the finished Analytics:

Delete the requested jobs once downloaded:

To empty the list of completed jobs you can delete the ones that are already downloaded:

 


Author

@Andreas Hauri

 

© 2024 Unique AG. All rights reserved. Privacy PolicyTerms of Service