The editing software's API

Which requests the editing software supports and how to carry them out
The requests are carried out with the method POST on URL i.e.{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: /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

How to get messages on Webhook URL that is specified in the project’s settings

The project's settings
Every incoming or outcoming message comes with the following json POST requests:
'id': the identifier of the message in the system,
'client': {
'id': the identifier of the client in the system,
'recepient': the identifier of the client in the messenger,
'client_type': the messenger’s type,
'name': the client’s name,
'avatar': the client’s avatar,
'created_at': the date when the client was created,
'tag': the subscription key,
'group': the bot to which the client is tied to,
'message': the message text,
'attachments': the array of links to files,
'message_id': the id of the block from which the message was sent from,
'project_id': the project’s id,
'is_input': 1 if the message is from a client, 0 if it’s from the bot,
'delivered': 1 if the message is sent successfully, 0 if there was an error,,
'error_message': the message explaining the error
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.

How to use a universal webhook

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
Type in the address value_client_id = my_client {"my_client":49177759, "message":"Hello world"}
The query will be the equivalent to the query below: {"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_

How to launch the bot

The bot’s launch
Launching the bot through the number on WhatsApp
Bot launch through Telegram id

How to work with messages

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:
"buttons": {"hint": "This text will be shown in Whatsapp",
"buttons": [
{"type": "reply",
"text": "What services we can provide",
"line": 0, "index_in_line": 0},
{"type": "reply",
"text": "Payment info",
"line": 0,
"index_in_line": 1},
{"type": "reply",
"text": "Our contact info",
"line": 1, "index_in_line": 0},
{"type": "reply",
"text": "Leave an application",
"line": 1, "index_in_line": 1}
Sending the message to the client
Sending messages in WhatsApp
Sending messages in bulk
Getting the message history
Clearing the message history

How to distribute the clients

Assigning a client to an employee
Loading clients into the system
Adding clients to the list
Removing clients from the list
Getting the clients list
Getting the subscribers list in any messenger

How to work with variables

Attributing variables
Obtaining variables

How to get client_id

Getting client_id by the platform_id value
How to get client id on Online chat
Where do you get the recipient? On the site that carries online chat “” you need to get the feature SaleBotPro.recipient_id with the help of JS.
How to get client id with the WhatsApp number
Getting client id with the phone number
Getting client id through email
Getting client id by the variable value

What other possibilities there are

Moving the transaction into the SalebotCRM state
Checking if the person follows the Instagram account
Checking if the phone number carries WhatsApp
Getting the list of messengers connected to the project (including group_id)
Getting the list of blocks from the bot’s schema
If you need additional methods, please contact customer support