Introduction
Welcome to the Quickchat AI API!
It’s a single endpoint that allows you to add conversational AI to your product.
Before you start, head over to the Quickchat AI dashboard to set up your AI’s Knowledge Base, customize your AI Assistant’s Settings and Personality.
Authentication
Include your API key and scenario_id in every request.
In order to obtain your API key, create an account and upgrade your subscription to include API access.
Chat
Initialise new conversation / new user history
curl https://chat.quickchat.ai/chat \
-H 'Content-Type: application/json' \
-d '{
"api_key": "<API_KEY>",
"scenario_id": "<SCENARIO_ID>",
"text": "Hello!"
}'
import requests, json
response = requests.post(
url="https://chat.quickchat.ai/chat",
json={
"api_key": "<API_KEY>",
"scenario_id": "<SCENARIO_ID>",
"text": "Hello!"
})
if response.status_code == 200:
data = json.loads(response.content)
else:
raise ValueError(
"Error code {}: {}".format(
response.status_code,
response.content.decode('utf-8')))
The above command returns JSON structured like this:
{
"ord_number": 2,
"conv_id": "abcd1234",
"reply": "Hey there! 🙂"
}
conv_id
is an optional parameter. Request which does not contain conv_id
starts a new conversation and newly-generated conv_id
is returned.
Associate conv_id
with your particular user to maintain conversation context across time and multiple user interactions.
This endpoint performs a single conversation exchange.
HTTP Request
POST https://chat.quickchat.ai/chat
Query Parameters
Parameter | Type | Description |
---|---|---|
api_key | string | Create an account and subscribe to obtain your API key. |
scenario_id | string | ID associated with your Quickchat API implementation. |
text | string | User input message |
Send message to AI
curl https://chat.quickchat.ai/chat \
-H 'Content-Type: application/json' \
-d '{
"api_key": "<API_KEY>",
"scenario_id": "<SCENARIO_ID>",
"conv_id": "abcd1234",
"text": "Hello!"
}'
import requests, json
response = requests.post(
url="https://chat.quickchat.ai/chat",
json={
"api_key": "<API_KEY>",
"scenario_id": "<SCENARIO_ID>",
"conv_id": "abcd1234",
"text": "Hello!"
})
if response.status_code == 200:
data = json.loads(response.content)
else:
raise ValueError(
"Error code {}: {}".format(
response.status_code,
response.content.decode('utf-8')))
The above command returns JSON structured like this:
{
"ord_number": 236,
"reply": "Hey, great to hear from you again! 😉"
}
Say something to the AI and receive a response.
When conv_id
is provided, the corresponding conversation (by a particular user) will be continued. If no matching conversation for given scenario_id
and conv_id
is found conv_id does not exist
error is returned.
HTTP Request
POST https://chat.quickchat.ai/chat
Query Parameters
Parameter | Type | Description |
---|---|---|
api_key | string | Create an account and subscribe to obtain your API key. |
scenario_id | string | ID associated with your Quickchat API implementation. |
conv_id | string Optional | Identify a particular conversation/user. |
text | string | User input message. |
skip_reply | bool | If true, AI does not provide reply. Message from user appended to conversation history. |
override_ai | bool | If true, message from AI appended to conversation history. |
Errors
The following error codes may be returned by the API:
Error Code | Description | Meaning |
---|---|---|
400 | The following parameters must be provided: api_key , scenario_id , text |
Please make sure all required parameters are provided |
400 | conv_id abcd1234 does not exist |
Please ensure that conv_id you are referring to is correct |
401 | Unauthorized | Please make sure that your api_key and scenario_id are correct (see dashboard settings) |
500 | Internal Server Error | There is an issue on our side. Please get in touch with support. |
503 | Service Unavailable | Our servers are overloaded or temporarily unavailable due to maintenance. If problem persists, please get in touch with support. |