Chatbots endpoint
The Chatbots endpoint lets you send an asynchronous query to an existing chatbot and retrieve the response.
- curl examples reference the
API_ROOT
,API_TOKEN
, andIB_CONTEXT
values as variables. If you don’t set up these variables, define them in the request. - All endpoints support the IB-Context header. Organization members must set the
IB-Context
header as their organization ID to complete the request with their organization account. While optional, it’s a best practice to include theIB-Context
header in all requests. - All endpoints use the standard HTTP response status codes. For each endpoint, some common status codes are listed.
Create chatbot query (async)
Description
Send an asynchronous query to a chatbot by making a POST
request to API_ROOT/v2/queries
. Each request returns a query_id
that can be used to check the query’s status and get the response.
Request body
Parameters are required unless marked as optional.
Response status
Response schema
Examples
Request (curl)
Response
Get query status and response
Description
Get the status of an asynchronous chatbot query by sending a GET
request to API_ROOT/v2/queries/<QUERY-ID>
. The query ID value is returned in the response of the create chatbot query request. If the query status is COMPLETE
, this request also returns the query response.
Request body
There is no request body. Use the request URL to specify the query ID.
Response status
Response schema
The response body is a JSON object containing the query ID and status. If the query status is COMPLETE
, the query response is also returned. If the query status is FAILED
an error message is returned instead.