Docs

Query Projects



Request:

import requests

payload = { "question": "What is the average sales cycle last quarter?", "project_id": "1234567890" }
headers = { "Authorization": "Bearer <API_KEY>" }

request.post(
  url="https://api.app.athenic.com/api/query/project-question",
  headers=headers,
  json=payload,
)

data = response.json()
curl --request POST \
  --url https://api.app.athenic.com/api/query/project-question \
  --header 'Authorization: Bearer <API_KEY>' \
  --data '{"question": "What is the average sales cycle last quarter?", "project_id": "1234567890"}'
HttpResponse<String> response = Unirest.post("https://api.app.athenic.com/api/query/project-question")
  .header("Authorization", "Bearer <API_KEY>")
  .body("{\"question\": \"What is the average sales cycle last quarter?\", \"project_id\": \"1234567890\")
  .asString();
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.app.athenic.com/query/project-question',
  headers: { 'Authorization': 'Bearer <API_KEY>', 'Content-Type': 'application/json'},
  body: '{"question": "What is the average sales cycle last quarter?", "project_id": "1234567890"}'
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.app.athenic.com/api/query/project-question",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"question\": \"What is the average sales cycle last quarter?\", \"project_id\": \"1234567890\"}",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer <API_KEY>",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}