2 min read
The chat.smarterbot.ai Creation API provides functionality to create a new chatbot by sending a POST request to the /chat/Chatbot/Add endpoint.
chat.smarterbot.ai
POST
/chat/Chatbot/Add
Request URL: https://chat.smarterbot.ai/chat/Chatbot/Add
Method: POST
The API request must include the following headers:
Authorization: <Your-Secret-Key>
Content-Type: application/json
The request body should contain the following parameters:
{ // string, required - The time zone of the chatbot (e.g., Asia/Shanghai, America/New_York) "timeZone": "Asia/Shanghai", // integer, required - Must be 0 for generic chatbot "type": 0}
timeZone
type
const res = await fetch('https://chat.smarterbot.ai/chat/Chatbot/Add', { method: 'POST', headers: { "Authorization": "<Your-Secret-Key>", "Content-Type": "application/json"}, body: JSON.stringify({ "timeZone": "Asia/Shanghai", "type": 0})});const data = await res.json();console.log(data);
import requestsimport jsonurl = 'https://chat.smarterbot.ai/chat/Chatbot/Add'headers = { "Authorization": "<Your-Secret-Key>", "Content-Type": "application/json"}data = { "timeZone": "Asia/Shanghai", "type": 0}response = requests.post(url, headers=headers, json=data)data = response.json()print(data)
curl 'https://chat.smarterbot.ai/chat/Chatbot/Add' \ -X POST \ -H 'Authorization: <Your-Secret-Key>' \ -H 'Content-Type: application/json' \ -d '{"timeZone":"Asia/Shanghai","type":0}'
POST /chat/Chatbot/Add HTTP/1.1Host: chat.smarterbot.aiAuthorization: <Your-Secret-Key>Content-Type: application/json{ "timeZone": "Asia/Shanghai", "type": 0}
The API response will be a JSON object with the following structure:
{ // string - The unique identifier (ID) of the created chatbot "Data": "3254a9d0424c4806b9ea3d0763xxxxxx", // string - API version "Version": "1.0.0", // boolean - Operation success status "Success": true, // integer - HTTP status code "Code": 200, // string - Error message if any "Message": ""}
If the request fails, you should: 1. Check the HTTP status code for network-level errors 2. Examine the `Code` and `Message` fields in the response for business-level errors 3. The `Message` field will contain detailed error information
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Post Comment