Analytics APIs
Last updated
Last updated
Using the API keys within the platform it's possible to use code to create assets such as Responses, Intents, Entities, Builds and many more things. In addition you can also use that API key to be able to fetch the analytics programmatically.
To get an API key, click on the profile button in the bottom left of the screen, and then Edit Profile
. From the resulting page you'll see the section for API keys, and from there you can create a new Key. Existing keys will look something like the view below.
Please note that when creating a key you'll be given a prefix
along with an api key
. While the prefix will always be visible, the API key will only be shown to you once so make a note of it in a safe place.
To fetch Analytics data, you'll need to ensure you have Fetch Analytics
selected in the list of permissions.
There are a number of APIs for various pieces of data, and accessing them is generally all the same. For example, if using NodeJS, the following will work..
Each API request has a number of common parameters that appear on the query string
of the URL. These are :
dateFrom
- the start date for the analytics.
dateTo
- the end date for the returned analytics
client
- the workspace name to fetch analytics for.
resolution
- this represents the granularity of the data returned. The value can be either hour
, day
, week
, month
or quarter
. Note that when this resolution is used, it'll modify the dateFrom
to be the start of that resolution. For example, if dateFrom
is 2024-04-16T10:57:12.873Z
but the resolution is set to month
, then for the purpose of the returned data, dateFrom
will end up being 2024-04-01T00:00:00.000Z
- ie, the start of the month.
The following table lists out all the APIs that are available to be used.
api/agent/analytics/user
The number of users created, and active within the selected time period. Note, this filters out conversations that have not interacted with the bot at all.
api/agent/analytics/nlp
The number of natural language inputs that have had a success, and those that have not been able to match an intent for the provided time period.
api/agent/analytics/message
The number of chat messages sent by the users in the selected time period.
api/agent/analytics/active-channel
The channel used by the users within the time period specified.
api/agent/analytics/message-groups
The identified topic the user was asking about for the days within the time period.
api/agent/analytics/sentiment
The number of positive, negative and neutral conversations for the given time period.
api/agent/analytics/events
A count of the number of times each event in the workspace has been called during the given time period.
api/agent/analytics/user/detail
Pie chart data for channel, country, language and rating for the users in the selected time period.
api/agent/analytics/response
The responses used to handle user queries within the time period specified. Each entry will identify the number of views, likes and dislikes for each response, along with an indication of if that response was triggered by a button, or through natural language.
api/agent/analytics/urlTracking
The counts of the links clicked on within the responses within the time period specified.
api/agent/analytics/blocks
A breakdown of which response was shown to the user by date within the time period selected.
api/agent/analytics/intervention
The number of interventions to live agents in the selected time period.
api/agent/analytics/intervention/average-time-by-agent-series
The average time for a conversation that has been handed over to a live agent within the time period specified.
api/agent/analytics/intervention-detail
The channel, topic and outcome of any live agent interventions started within the time period specified.
api/agent/analytics/intervention/average-time
The average time and duration for the the interventions within the time period specified.
api/agent/analytics/active-user-language
Returns the language used by the user for the given time period.
Please note, this is not an exhaustive list and is subject to change as new information is added to the platform. For a more up to date view, please use the Network tab within the developer console in a browser. Go to the Analytics page within Logicdialog and filter for "analytics". This will show you all the available analytics endpoints and examples of the data they return.