Download history JSON using Google Chrome

I heard about this interesting “trick” on a forum a while back, but unfortunately I cannot even find the forum post anymore. 🙁

So here is how you do it.

Use Google Chrome

This will probably work in all browsers, but I know for sure that it works in Google Chrome.

Go to the History tab inside Dialogflow

Open Google Chrome developer tools

In Google Chrome, you can go to Developer tools by going to View > Developer > Developer Tools.

Remember: you should do this in the same tab in which you opened the Dialogflow History. The image below is a screenshot from Google’s website, which is why the tab is empty.

Click on the Network tab

Select the All requests tab

Select an appropriate date range to view the History

Clear any existing information

Click on the “Clear” icon to clear any existing information (if you have any). Otherwise you might confuse yourself with multiple requests in the next few steps.

Below, I show a before and after using the Clear button.

The reason I asked you to clear the information is because you want to identify a very specific response.

Click on the Refresh button

Choose the line item which starts with search

In the All responses list view, you will see a few list items. Choose the one which starts with the word “search”

When you click on the line item, on the right side you will see a JSON response.

Right click and copy the JSON response

Right click on the search line item and select Copy Response.

This JSON response has all the information you need to construct your own conversation logs.

Here is what the response looks like when I paste it into the Webstorm IDE. The outer “sessionConversations” array has individual JSON objects, and each JSON object represents a single session (the way a session is defined in Dialogflow ES) and it is a collection of “interactions” (i.e. array of interactions).

Inside the “interactions” array, you will find the individual queries and responses for the given session. You can drill down into each of these response objects and get all the relevant information such as the user’s query, the bot’s response, the input and output contexts at that step in the conversation etc.

While this JSON format has all the information you need, it will be much easier to use this information if you could convert it into a CSV format.