Query Project

Query an existing project

POST https://api.app.athenic.com/api/query/project-question

The Athenic AI API uses API keys to authenticate requests. You can view your API keys on your teams settings page.

Projects must be created in the application before querying. This API request will generate valid SQL given an input question / phrase, and the ID of the project to use.

Headers

Request Body

{
        "query_id": "Query_ID_Example",
        "query_string": "The aliased SQL output to run in our application",
        "dataset_raw_query": "The raw SQL you can paste into your database",
        "explanation": "An English explanation of how AskEdith answered your question",
}

Request:

import http.client

conn = http.client.HTTPSConnection("api.app.athenic.com")

payload = '{"question": "What is the average sales cycle last quarter?", "project_id": "1234567890"}'

headers = { 'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrIjoiQjZSU0lpRTkifQ.p54KkQWA0icjiKusC6-Odhuii_Y9vbZeaNsJN5PBbEs" }

conn.request("POST", "/api/query/projects", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Last updated