Create a new bot
curl --request POST \
--url https://botsettings.messagesimproved.com/create_bot \
--header 'Content-Type: application/json' \
--header 'admin-email: <admin-email>' \
--header 'api-key: <api-key>' \
--data '
{
"name": "BobBot",
"openingMessage": "Hello! How can I assist you today?",
"prompt": "Please assist users with common queries about our services."
}
'import requests
url = "https://botsettings.messagesimproved.com/create_bot"
payload = {
"name": "BobBot",
"openingMessage": "Hello! How can I assist you today?",
"prompt": "Please assist users with common queries about our services."
}
headers = {
"api-key": "<api-key>",
"admin-email": "<admin-email>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'api-key': '<api-key>',
'admin-email': '<admin-email>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'BobBot',
openingMessage: 'Hello! How can I assist you today?',
prompt: 'Please assist users with common queries about our services.'
})
};
fetch('https://botsettings.messagesimproved.com/create_bot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://botsettings.messagesimproved.com/create_bot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'BobBot',
'openingMessage' => 'Hello! How can I assist you today?',
'prompt' => 'Please assist users with common queries about our services.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"admin-email: <admin-email>",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://botsettings.messagesimproved.com/create_bot"
payload := strings.NewReader("{\n \"name\": \"BobBot\",\n \"openingMessage\": \"Hello! How can I assist you today?\",\n \"prompt\": \"Please assist users with common queries about our services.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("admin-email", "<admin-email>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://botsettings.messagesimproved.com/create_bot")
.header("api-key", "<api-key>")
.header("admin-email", "<admin-email>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"BobBot\",\n \"openingMessage\": \"Hello! How can I assist you today?\",\n \"prompt\": \"Please assist users with common queries about our services.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://botsettings.messagesimproved.com/create_bot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["admin-email"] = '<admin-email>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"BobBot\",\n \"openingMessage\": \"Hello! How can I assist you today?\",\n \"prompt\": \"Please assist users with common queries about our services.\"\n}"
response = http.request(request)
puts response.read_body{
"bot_id": "74b96c5b-7376-430c-a6d7-b78cfd6aa32c"
}Bot
Create Bot
Creates a new bot with the specified name, opening message, and prompt.
POST
/
create_bot
Create a new bot
curl --request POST \
--url https://botsettings.messagesimproved.com/create_bot \
--header 'Content-Type: application/json' \
--header 'admin-email: <admin-email>' \
--header 'api-key: <api-key>' \
--data '
{
"name": "BobBot",
"openingMessage": "Hello! How can I assist you today?",
"prompt": "Please assist users with common queries about our services."
}
'import requests
url = "https://botsettings.messagesimproved.com/create_bot"
payload = {
"name": "BobBot",
"openingMessage": "Hello! How can I assist you today?",
"prompt": "Please assist users with common queries about our services."
}
headers = {
"api-key": "<api-key>",
"admin-email": "<admin-email>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'api-key': '<api-key>',
'admin-email': '<admin-email>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'BobBot',
openingMessage: 'Hello! How can I assist you today?',
prompt: 'Please assist users with common queries about our services.'
})
};
fetch('https://botsettings.messagesimproved.com/create_bot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://botsettings.messagesimproved.com/create_bot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'BobBot',
'openingMessage' => 'Hello! How can I assist you today?',
'prompt' => 'Please assist users with common queries about our services.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"admin-email: <admin-email>",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://botsettings.messagesimproved.com/create_bot"
payload := strings.NewReader("{\n \"name\": \"BobBot\",\n \"openingMessage\": \"Hello! How can I assist you today?\",\n \"prompt\": \"Please assist users with common queries about our services.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("admin-email", "<admin-email>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://botsettings.messagesimproved.com/create_bot")
.header("api-key", "<api-key>")
.header("admin-email", "<admin-email>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"BobBot\",\n \"openingMessage\": \"Hello! How can I assist you today?\",\n \"prompt\": \"Please assist users with common queries about our services.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://botsettings.messagesimproved.com/create_bot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["admin-email"] = '<admin-email>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"BobBot\",\n \"openingMessage\": \"Hello! How can I assist you today?\",\n \"prompt\": \"Please assist users with common queries about our services.\"\n}"
response = http.request(request)
puts response.read_body{
"bot_id": "74b96c5b-7376-430c-a6d7-b78cfd6aa32c"
}Headers
API key for authentication.
Email of the admin making the request.
Body
application/json
The name of the bot.
Example:
"BobBot"
The initial message that the bot will send.
Example:
"Hello! How can I assist you today?"
The prompt that defines the bot's behavior.
Example:
"Please assist users with common queries about our services."
Response
Bot created successfully
Unique identifier for the newly created bot.
Example:
"74b96c5b-7376-430c-a6d7-b78cfd6aa32c"
