Ask a question to AskAI
curl --request POST \
--url https://myaskai.com/api/1.1/wf/ask-ai-query \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"api_key": "<string>",
"query": "<string>"
}
'import requests
url = "https://myaskai.com/api/1.1/wf/ask-ai-query"
payload = {
"id": "<string>",
"api_key": "<string>",
"query": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', api_key: '<string>', query: '<string>'})
};
fetch('https://myaskai.com/api/1.1/wf/ask-ai-query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://myaskai.com/api/1.1/wf/ask-ai-query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'api_key' => '<string>',
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://myaskai.com/api/1.1/wf/ask-ai-query"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"api_key\": \"<string>\",\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://myaskai.com/api/1.1/wf/ask-ai-query")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"api_key\": \"<string>\",\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://myaskai.com/api/1.1/wf/ask-ai-query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"api_key\": \"<string>\",\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"references": [
{
"content": "<string>",
"link": "<string>",
"score": 123,
"title": "<string>"
}
],
"suggestedQuestions": [
"<string>"
],
"unknown_answer": "no"
}API Documentation
Query API
Use the Query API to create an integratation with your AI agent.
POST
/
ask-ai-query
Ask a question to AskAI
curl --request POST \
--url https://myaskai.com/api/1.1/wf/ask-ai-query \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"api_key": "<string>",
"query": "<string>"
}
'import requests
url = "https://myaskai.com/api/1.1/wf/ask-ai-query"
payload = {
"id": "<string>",
"api_key": "<string>",
"query": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', api_key: '<string>', query: '<string>'})
};
fetch('https://myaskai.com/api/1.1/wf/ask-ai-query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://myaskai.com/api/1.1/wf/ask-ai-query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'api_key' => '<string>',
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://myaskai.com/api/1.1/wf/ask-ai-query"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"api_key\": \"<string>\",\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://myaskai.com/api/1.1/wf/ask-ai-query")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"api_key\": \"<string>\",\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://myaskai.com/api/1.1/wf/ask-ai-query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"api_key\": \"<string>\",\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"references": [
{
"content": "<string>",
"link": "<string>",
"score": 123,
"title": "<string>"
}
],
"suggestedQuestions": [
"<string>"
],
"unknown_answer": "no"
}With our API you can build your own internal tools or workflows and harness the power of your AI agent wherever you want, however you want.
The API is powerful, but very simple. You input a question and get an answer back, along with the references/content used in the answer.
See full details of the API below. Alternatively, you can use our pre-built integrations with Slack, Microsoft Teams or Zapier.
If your AskAI doesn’t know the answer, the API will return a field to confirm an answer wasn’t found:
"unknown_answer": "yes"The
query field has a 750 character limit. If this is exceeded, you will see an error: {"error":"This question is too long. Please ensure questions are less than 750 characters."}If human handover guidance is triggered the API response will include:
"human_handover": trueBody
application/json

