The editing software's API
Which requests the editing software supports and how to carry them out
Last updated
Which requests the editing software supports and how to carry them out
Last updated
The requests are carried out with the method POST on URL i.e. https://chatter.salebot.pro/api/{api_key}/{action}
Where it’s located: api_key is the key to accessing API which is obtained in the project’s settings:
You can get the access key by using the variable #{api_key}. It holds the relevant generated key. Don’t forget to generate one before using it.
When copying the url of the query from this page a space is put in that needs to be deleted when calling
An example of copying the link the wrong way: https://chatter.salebot.pro /api/callback
The space after .pro is easy to not notice but if it’s left in place the query won’t work
When sending the request with the GET method, don’t use prohibited words. Look into the right formation of GET requests
Every incoming or outcoming message comes with the following json POST requests:
If the request came back with an error it won’t be resent. If the server came back with an error then the notifications will come through despite this.
These methods now can be launched with both the POST and the GET request.
Previously, the parameters (with which the clients’ methods were launched, i.e. client_id) were very strictly written in our methods and it would implement some restrictions when using them with the third-party services.
Now you can point out in which parameter of the request Salebot will look for the identifier of the user: for this, a parameter with the prefix value_ is used, like value_user_id and value_group_id.
Also the method for sending the callback callback can be launched by transmitting an email (client_email) and a client’s phone number (client_phone).
Methods callback and whatsapp_callback aren’t tied to the parameter’s names. You can specify which parameter will hold the client’s phone number, email and id.
It’s useful when you’re setting up the webhook’s reception through another site.
To specify which variable holds client_id you need to transfer value_client_id and mention the name of the parameter with this value in it
To specify which variable holds phone you need to transfer value_phone and mention the name of the parameter with this value in it
To specify which variable holds email you need to transfer value_email and mention the name of the parameter with this value in it
To specify which variable holds user_id you need to transfer value_user_id and mention the name of the parameter with this value in it
To specify which variable holds group_id you need to transfer value_group_id and mention the name of the parameter with this value in it
Example:
Type in the address value_client_id = my_client
https://chatter.salebot.pro/api/d3f31dabef80ddeb73d43938b4ef8bb0/callback?value_client_id=my_client
{"my_client":49177759, "message":"Hello world"}
The query will be the equivalent to the query below:
https://chatter.salebot.pro/api/d3f31dabef80ddeb73d43938b4ef8bb0/callback
{"client_id":49177759, "message":"Hello world"}
As you can see, the name of the parameter that holds the name is differentiated by the prefix value_
POST
https://chatter.salebot.ai/api/<api_key>/callback
The method can be used for launching the workflow for the client or for approving the action on a third-party service. This message won’t be visible for the client. Additionally transferred parameters are saved in the variables. The method for sending the callback can now be turned on by sharing an email (client_email) or the client’s phone number (client_phone)
api_key
string
access token
client_phone
string
phone number using which the client is found
client_email
string
email using which the client is found
client_id
string
client’s id in the editor
message
string
the message text
POST
https://chatter.salebot.ai/api/<api_key>/whatsapp_callback
This method launches the bot in WhatsApp after the client registers through the site or after they leave a request with their phone number Additionally transferred parameters are saved to the variables
api_key
string
access token
name
string
the client’s name
message
string
the message text
phone
string
the client's phone number
bot_id
string
the bot's id
POST
https://chatter.salebot.ai/api/<api_key>/tg_callback
The method can be used for launching the workflow or confirming actions on a third-party site. This message won't be visible to the client. Additionally transferred parameters are saved to the variables
api_key
string
access token
message
string
the message text
user_id
string
the user's id in Telegram
group_id
string
the bot's name (must end in bot)
Params for sending messages
attachment_type can take these values: image, video, link, file, audio When sending attachments the parameter message isn’t mandatory
buttons identifies the buttons that will be attached to the message. The buttons’ format is comparable to the button’s advanced settings. Two variants of the buttons’ transmition are possible: one with the tooltip in messengers without buttons and one without it
Here’s an example of the buttons parameter:
POST
https://chatter.salebot.ai/api/<api_key>/message
This method can be used for sending messages with notifications. The parameter message is mandatory if you’re not sending a file. If you are, then the text isn’t needed
api_key
string
the access key
message_id
string
the sending block's number
message
string
the message text
client_id
string
the client's id in the editor
attachment_type
string
the file display type
attachment_url
string
the file's URL
buttons
object
buttons
POST
https://chatter.salebot.ai/api/<api_key>/whatsapp_message
Allows sending a message from the name of the connected bot to the mentioned number whatsapp_bot_id has to be taken from the “Messengers and chats” section. Each connected WhatsApp page gets a unique identification
api_key
string
the access key
message_id
string
the sending block's number
whatsapp_bot_id
number
the WhatsApp bot that sends the message
attachment_url
string
the file's url
attachment_type
string
the file display type
message
string
the message text
phone
string
the recipient's phone number
POST
https://chatter.salebot.ai/api/<api_key>/broadcast
The method allows message distribution. If the param clients isn’t mentioned, the broadcast will be sent out to all users. It’s necessary to either send a file or a text
api_key
string
the access key
message_id
string
the sending block's number
list
string
the list of recipients' numbers
shift
string
the amount of seconds between messages. 0.2 by default
message
string
the message text
clients
array
the recipients' ids
attachment_type
string
the file display type
attachment_url
string
the file's URL
buttons
string
buttons
GET
https://chatter.salebot.ai/api/<api_key>/get_history?client_id=
Getting the message history. You can get the client_id param HERE
api_key
string
the access key
client_id
string
the client's id
GET
https://chatter.salebot.ai/api/<api_key>/clear_history?client_id=
api_key
string
the access key
client_id
string
the client's id
GET
https://chatter.salebot.ai/api/<api_key>/assign_to_user
The method allows assigning a client to an employee. The email parameter is optional. If the email isn’t provided, it will be distributed through the system’s algorithm
api_key
string
the access key
client_id
String
the client's id
String
the worker's email (optional)
GET
https://chatter.salebot.ai/api/<api_key>/load_clients
The method allows loading clients into the system. When uploading WhatsApp clients you can transfer the number freely with the @s.whatsapp.net at the end or without it.
You can get the group id (group_id) here through /api/<api_key>/connected_channels
(if client_type=13 (telephony) then group_id=””)
You can see the type of messenger the client came from (client_type)
Ex.: [{"platform_id":"79875555555","group_id":34810,"client_type":6}]
api_key
string
the access key
platform_id
String
the phone number
group_id
String
the group id
client_type
String
the type of messenger the client came from
POST
https://chatter.salebot.ai/api/<api_key>/add_to_list
api_key
string
the access key
list_id
integer
the list's number
clients
array
the clients' numbers' array
POST
https://chatter.salebot.ai/api/<api_key>/remove_from_list
api_key
string
the access key
list_id
integer
the list's number
clients
array
the clients' numbers' array
POST
https://chatter.salebot.ai/api/<api_key>/get_clients
api_key
string
the access key
offset
string
offset from the first element
limit
integer
the amount of elements in the answer. 500 by default, max. 500
list
string
the list's number
POST
https://chatter.salebot.ai/api/<api_key>/subscribers
Getting the information on the clients in the chosen messenger
api_key
string
the access key
page
integer
tag
string
the tag that was mentioned on t subscription page
group
integer
the id of the group the subscriber is tied to
date_from
integer
timestamp of the date after they subscribed
date_to
integer
timestamp of the date they subscribed until
client_type
integer
the id of the messenger to which you need to sub list. if you change nothing all clients come up
POST
https://chatter.salebot.ai/api/<api_key>/save_variables
Allows saving variables in the application and in the client. The request of attributing variables by default adds to transaction variables. If you need to change the variables in the profile you need to add the prefix client. Ex. for mobile: client.phone
The param clients allows attributing variables in bulk
Ex.: {"client_id":49177759, "variables": {"client.phone":"1234567890"}}
api_key
string
the access key
clients
array
clients id array for assigning variables
client_id
string
client's id
variables
object
variable hash (key value)
GET
https://chatter.salebot.ai/api/<api_key>/get_variables?client_id=
api_key
string
access token
client_id
string
client id
POST
https://chatter.salebot.ai/api/<api_key>/find_client_id_by_platform_id
The method returns the client id for executing requests to the API
Example of parameters: {"platform_ids": ["571830542", "256865200"]}
string
access key
platform_ids
string
ids array in the messenger
GET
https://chatter.salebot.ai/api/<api_key>/online_chat_client_id?recipient=
This method allows to integrate the site and chatbot, i.e. if a person went on the page with the special offer, you can send out instantly a message about the offer in the chat
api_key
string
access token
tag
string
customer tag
name
string
the client's name
recipient
string
the dialogue id on the site
Where do you get the recipient? On the site that carries online chat “Salebot.pro” you need to get the feature SaleBotPro.recipient_id with the help of JS.
GET
https://chatter.salebot.ai/api/<api_key>/whatsapp_client_id?phone=
The method gives back the client id for executing requests to the API if you know the client’s phone number in WhatsApp. If there is no such client with this number, you’ll get a 404.
api_key
string
access token
phone
string
the phone number
GET
https://chatter.salebot.ai/api/<api_key>/find_client_id_by_phone?phone=
The method gives back the client id for executing requests to the API. The search happens through WhatsApp clients, as well as through variables.
api_key
string
access token
phone
string
the phone number
GET
https://chatter.salebot.ai/api/<api_key>/find_client_id_by_email?email=
The method gives back the client id for executing requests to the API. The search happens through variables.
api_key
string
access token
string
email for search
GET
https://chatter.salebot.ai/api/<api_key>/find_client_id_by_var?var=&val=
The method gives back the client id for executing requests to the API
api_key
string
access token
var
string
the name of the variable the search will go on through
val
string
the variable value
POST
https://chatter.salebot.ai/api/<api_key>/set_order_state
The transaction number can be obtained in the SalebotCRM workflow’s editing window.
api_key
string
the access key
client_id
string
client's id
state_id
string
the state number to transfer the client’s transaction into
GET
https://chatter.salebot.ai/api/<api_key>/check_insta_subscription
Can be called with both the POST method and the GET method
api_key
string
the access key
user_name
string
the username of the client you want to check
login
string
the login of the bot that’s being checked
GET
https://chatter.salebot.ai/api/<api_key>/check_whatsapp
To use the method you HAVE to have connected WhatsApp and Salebot
Can be called with both the POST method and the GET method The phone number can be transferred in any format
api_key
string
access token
phone
string
the phone number
GET
https://chatter.salebot.ai/api/<api_key>/connected_channels
The function returns the parameter group_id to each messenger and it is the one that needs to be transferred when loading the clients
The field status also returns for WhatsApp, and it holds a value of: NOT_STARTED = 0 STARTED = 1 ASLEEP = 2 STOPPED = 3
api_key
string
access token
GET
https://chatter.salebot.ai/api/<api_key>/get_messages
api_key
string
access token
If you need additional methods, please contact customer support