Query History

On this page:

📘

"Query History" and "Query Logs" are used interchangeably.

For our purposes, these terms are considered to be synonymous.

If you're working in the Integrator Portal, you will see this referred to as "Query History". If you are working directly with the API, "Query Log(s)" is predominantly used.

What is Query History?

Query History is a central place in the Integrator Portal where information about queries is logged for review. In this section of the Portal, you're able to view, search, and filter queries from both Production and Staging environments for all of your Projects. Searching and filtering queries allows you to easily see what queries are working and what needs to be trained.

The same information that is contained in Query History in the Portal can also be accessed directly through the API via the GET endpoint: /autoql/management/api/v1/query/logs

Query History Overview

In the Portal

Navigate to "Query History" in the Integrator Portal. Here, you'll find information regarding queries that have been asked. This summary includes the following information:

  • Natural Language Query - The natural language query text that was typed into Data Messenger or into a Dashboard tile.
  • Source - Where that query was entered (in Data Messenger, in Dashboards, or other) and the type of request (made by a User, Scheduled (in a Dashboard), or other).
  • Project - Which project the query came from/is associated with.
  • User - The user who made the query.
  • Time Queried - The date and time the query was made at.
  • Status - Whether or not the query successfully returned data. The green checkmark represents a query that successfully returned data. A yellow exclamation mark represents an unsuccessful data return.
  • Production Toggle - This toggle (which sits above the Query History table) allows you to switch your view between Production and Sandbox Environment data. See Managing Projects for more details on Project environments.

📘

Helpful Tip: Click to view the SQL returned from NL queries

Click on any row in the Query History table to expand your view and display the SQL that was generated.

With the API

The same information that is made available in the Query History table in the Integrator Portal is accessible through the GET endpoint: /autoql/management/api/v1/query/logs

Search Query History

In the Portal

The search bar on the left side of the toolbar can be used to narrow down the list of queries you are reviewing. This allows you to view results that contain a specific keyword (e.g. "profit"), or it can be used to look up a specific natural language query.

With the API

In the API, historical queries can be accessed through Query Logs. To search Query Logs, use: /autoql/management/api/v1/query/logs&text={text}

Filter Query History

In the Portal

Filtering Query History is made easy in the Integrator Portal through the dropdown menu located at the top right side of the table toolbar. Multiple filter selections can be applied simultaneously and filters can be easily applied or removed simply by clicking on them.

With the API

To filter Query Logs, apply any combination of the following parameters to: /autoql/management/api/v1/query/logs&{param}={value}

Filter Parameters

  • project_id - A string ID value belonging to a project
  • user_id - A string ID that belongs to a specific user
  • is_successful - A boolean of whether or not a query was successful in returning data or not
  • source - A string for the source of the query (data_messager, databoards, etc...)
  • start_time - An epoch timestamp for the earliest date to filter queries by
  • end_time - An epoch timestamp for the latest date to filter queries by

A list of available user_id or source values can be retrieved from by passing either parameter into the request URL:
/autoql/management/api/v1/query/logs&attribute={param}