Query (Explain)
Query API Request and Response
Last updated
Query API Request and Response
Last updated
Our Query API allows a user to ask questions to your AskAI via a simple API call.
If your AskAI doesn't know the answer, the API will also return an additional field to confirm an answer wasn't found as well as 3 suggested questions the user can retry (these have a very high likelihood of being answered correctly):
"unknown_answer": "yes",
"suggestedQuestions": ["Example question", ...]
The query
field has a 400 character limit. If this is exceeded you will see an error: {"error":"This question is longer than 400 characters. Please ensure questions are less than 400 characters."}
AskAI ID
AskAI API Key
Question to AskAI
POST /api/1.1/wf/ask-ai-query HTTP/1.1
Host: myaskai.com
Content-Type: application/json
Accept: */*
Content-Length: 45
{
"id": "text",
"api_key": "text",
"query": "text"
}
Successful response
{
"answer": "text",
"references": [
{
"content": "text",
"link": "https://example.com",
"score": 1,
"title": "text"
}
]
}