-
Notifications
You must be signed in to change notification settings - Fork 0
Report Query API
Report Query API for programatic access to analytic data.
This API provides an interface to submit a SQL query and retrieve the result. The interface is designed to cache results, prevent the same query from being run concurrently from multiple clients. Multiple identical queries to the same organization are coalesced into the same query and responces are sent to all clients once the query completes.
The API also assumes the client has the ability to long poll and wait an arbitrary amount of time for a response. If the client recieves a gateway timeout or otherwise times the request out, it should resumit the same identical request to retrieve the response.
All calls are made on the standard report endpoint:
https://report.data-cortex.com
Get information about the logged in user.
POST /api/1/auto_query
org_id - number - Organization ID
sql - string - SQL Query string
expire_datetime - string - ISO Datetime when this query should expire. This parameter must be set to a date time in the future. This is used to cache subsiquent requests and return the same response. Multiple clients requesting identical SQL queries will be combined and responded to from the same backend query until the query expires. In general this should be set at least 24 hours in the future.
200 OK
auto_query_id - number - Auto Query ID
org_id - number - Org ID
sql_md5 - string - MD5 of the SQL query
sql - string - SQL Query that was run
expire_datetime - string - ISO Datetime of the query expiration.
create_ts - string - ISO Datetime when the query was created.
query_secs - number - Number of second to complete the query.
error - object - An object detailing the error from the backend analytic store. NULL if query was successful.
result - object - Result object, NULL if the query failed.
-
keys - list of string - List of strings for the keys of the result
-
value_arrays - list of list of values - List of lists of the results.
Elements are either strings or numbers.
403 Forbidden
Not logged in. Ensure you include a valid session_key cookie to the API call.