Create Bot
In this guide, we will walk through the process of manage a chatbot using an API
Prerequisites
Before you begin, make sure you have the following:
- ChatFly account to get access token.
- A development environment or tool for making HTTP requests, such as Curl or a programming language like Python.
Create Bot
API Endpoint
The API endpoint for creating a chatbot is:
Request Body
To create a chatbot, you need to send a POST request to the API endpoint with a JSON request body. Here’s an example request body:
-
bot_name (string): Your Chatbot’s Name
-
case_study (string, optional): Your Case Study.
Options available:
Customer Support
,Knowledge Management
,Teaching Education
,Lecture Assistant
,Toeic Learner Assistant
. -
is_visibility (string, optional): Set the visibility of your chatbot.
Options available:
private
,public
. -
domain (list(string)): website domain where you want to embed the bot.
-
collect_customer_info (list(string)): The information you want to collect from users.
-
rules (list(string)): The rule you want the bot to express when responding to messages.
-
gpt_model_name (string, optional): Specify the model you want to use. In this example, we’re using
gpt-3.5-turbo
.Options available
gpt-3.5-turbo
,gpt-3.5-turbo-16k
,gpt-4
-
temperature (float, optional): You can adjust the temperature parameter for response randomness. A value of
0
makes responses deterministic, while higher values increase randomness.Options are values as a float between
0
and1
-
custom_prompt (string, optional): You can provide an initial prompt for your chatbot.
-
bot_tone_type (int): Bot tone type.
-
custom_error_message (string): Your custom error message.
Example Request
Here’re example command sto create a chatbot using the ChatFly API:
Replace token
with your token access.
Bot Information
API Endpoint
The API endpoint for get bot information is:
Request Body
To get bot information, you need to send a Get request to the API endpoint with a Params request. Here’s an example params request:
- bot_id (string): id of your bot.
Example Request
Here’re example command sto get bot information using the ChatFly API:
Replace token
with your token access.
Response Body
The bot’s information is responded:
Information about response params in Request Body (Create bot)
.
Was this page helpful?