Chat with a Bot
This API allows you to interact with a Chatbot.
Generate your own API Key
The first thing you have to do to access Ollabot API, is by generating your own API Key. You can generate your API Key by following the steps here: Generate API Key.
Chat API Guide
The Chat API allows you to send a message to an existing chatbot by making a POST request to the /api/v1/chat
endpoint using the user's API key.
Endpoint
POST https://app.ollabot.com/api/v1/chat
Request Headers
The API request must include the following headers:
- Authorization: Bearer
<User-Api-Key>
- The user's API key for authenticating the request. - Content-Type: multipart/form-data - The content type of the request payload.
Parameters
The request body should contain the following parameters:
- botId (string, required): The unique identifier of the chatbot.
- message (string, required): The message to send to the chatbot.
- description (string, optional): A description or additional context for the message.
- file (file, optional): An optional file to send with the message.
Example Request
JavaScript
Python
Shell
Response
The API response will be a JSON object with the chatbot's reply:
Error Handling
If there are any errors during the API request, appropriate HTTP status codes will be returned along with error messages in the response body. Make sure to handle these errors gracefully in your application.