Salebot.ai
Search…
Official Instagram
Creating a chat bot on Instagram. You can automate Direct with Salebot
Chat bots in official Instagram are available to all professional accounts!!
Link is written in format https:/ig.me/m/salebotpro to form a link after the last slash, insert the login from your Instagram account.
The direct link works ONLY when it is opened via the app on the mobile device. The browser does not work!

How to prepare an account

The first thing to do is to connect your Instagram account to the professional page. To do this, open your Facebook professional account and create a professional page (or use an existing one). After creating, go to Profficional Page Settings
You go to page settings, scroll down and select Instagram
Next, click to connect account
Next, the login window opens, enter the login and password of the Instagram account. If the connection is successful, it will look like this:
If your Instagram account is not converted to a "professional" type, you should do it. To do this, click on the Go button (from the screenshot above), you are redirected to the authorization window, enter the login and password from the Instagram account.
The second option is to transfer the account to Professional type directly from Instagram:
The account type should be changed to PROFESSIONAL. If you have "Personal Account", then the integration will work NOT. It is necessary to have "Professional" one.
Then you go to the main page of the professional page, and there you can see the notification offering to allow access to messages from Instagram in the "Inbox" section:

How to Connect a Chatbot

To connect a chatbot to Instagram, you must login to Salebot via Facebook and give the appropriate permissions.
If you are already logged in via Facebook, you need to log out of the Salebot website and log back in via Facebook. And in the authorization window press "Edit settings"
The API does not have access to Instagram accounts that are not professional accounts.
Before you connect a chatbot to Instagram, you must transfer your account to a professional type and bind it to the Facebook professional page.
The account should be a professional one, not an personal account!
If you have configured everything according to the instructions, but the bot is not working, check the connection in the Instagram account itself. Settings - Privacy - Messages
There at the bottom you need to enable the "Allow access to messages" slider.

How to Use the Buttons

Instagram does not support sending inline and reply buttons simultaneously

Keyboards (reply)

Instagram supports up to 11 reply buttons
Buttons can only be placed in a line

In text (inline)

Instagram supports no more than 3 inline buttons
Buttons can lead to third-party resources. Visually these buttons are not different.
See the Buttons section for how to configure buttons

How to Use the Atachments

Instagram bots can only send pictures! They CANNOT send videos, audio and files!

How to Set Ice Breakers

Ice Breakers allow a person to start a conversation with a company using a list of frequently asked questions. You can ask up to four questions.
To configure the Ice Breakers, click on the corresponding button in the connected messenger

How to check your account subscription

Works only on Premium tariff
There are two ways to verify a subscription:
The first way to check subscription (in the Calculator field):
result = check_insta_subscription()
result is the name of the variable in which the test result is written. The variable can be called as you like.
The check must be done in the field "Variable for comparison". Both in the arrow and block result == True

Second way

When a user writes to a bot, the following, verified, and followers variables are displayed in the customer card.
The follow variable is the subscription check. It accepts the True value if the customer subscribes to the account, False - not subscribed, and None if the customer account is closed.
We can use this variable in the conditions blocks or in the arrows, in the "Variable for comparison" field to check the subscription or limit passage through the pipeline.
Example: a message will be sent to those who subscribed to us or who has a private account. If you write the word "prize" but your account is open and not subscribed , you won't get a message

How to Use the Comments on Instagram

Works only on premium and Official Instagram connection
If under your Official Instagram connection you see the inscription "Reconnect Instagram to work with comments", you need to reconnect Instagram to update the required permissions. To do this, click "Remove Bot"
Next click
Then click on the line "Don't have the account you want on the list? Click here"
You are switched to Facebook authorization. Enter your password, click "Continue"
Next, click on "Edit settings"
Select your accounts and professional pages, click "Next"
At this stage, make sure that all switches are turned on:
Click "Done". You have updated the required permissions
Next, select the account you want in the list, click "Done"
and turn on the "React to the comments" switch
The configuration is complete.
Does not work with comments under Reels and under postings of live-streams' recordings
When a user leaves a comment below, you will see a callback in the Customers section

You can use instagram_media_url to configure responses to certain posts on Instagram
For example, we will configure the response to three posts: depending on which post is commented, we will send the user a different cost in the comments and to the Direct at the same time. If a comment with the right keywords comes under another post, the user will receive a message with the text "by agreement".
In the condition we write client_wall_reply_new and list the words to be answered. Check "by the presence of keywords"
If we are interested in comments only under posts, write client_wall_reply_new_comment, and if comments are only under live-streams, write client_wall_reply_new_live
Does not work with comments under Reels and under postings of recordings of live broadcasts
In the "variable assignment" box, we set the condition for the text variable using IF.
And then use insta_create_comment to send a comment.
insta_create_comment("#{text}")
where #{text} is our text that we send to the user.
On the example of this text comes in the response comment and duplicated in the Direct. You can customize different answers.

How to use callbacks working with comments

The callback has the form:
client_wall_reply_new link id: text
where link - link to post, id - id entry, text - text comment
With comments we can work in two ways: to answer your comment or to write one message to the direct.
client_wall_reply_new is the common part of the callback. If we are interested in comments only under posts, write client_wall_reply_new_comment, and if comments are only under live-streams, write client_wall_reply_new_live

How to set up an automatic response to a comment under a post or live-stream

Copy the callback and move to the pipeline section. Create a block of type "Primary condition check" or "No condition state" and insert the copied callback into the condition. Check it by the presence of the keywords
client_wall_reply_new is the common part of the callback, which reacts to posts and live-streams. If we are interested in comments only under posts, write client_wall_reply_new_comment, and if comments are only under live-streams, write client_wall_reply_new_live
For live-stream (client_wall_reply_new_live) there is one feature: the bot will react only during the ether. If the live-stream is over, the bot will not see the comments under this stream and will not be able to answer.
In the response field, leave #{none}. In the field "Calculator" write:
insta_create_comment(' ^______^ ')
where the text of your comment is indicated in parentheses. Next, click "Done".
With this setting, your comment will come in response to a comment under a particular post and the keywords "Nice picture".
In order for the bot to respond to all comments under a particular post, in the field "Condition", insert a callback without the text of the comment:
Then under this particular entry will come an automatic response to any comment.
If you are in the field "Condition" leave only , your comment will come in response to comments under all posts (and no matter what text the user wrote)
If you in the "Condition" field leave client_wall_reply_new and keyword, then your comment will come in response to comments with a keyword under all posts.
In the same way you can react to the comments that users leave during the live-stream (it has a separate key client_wall_reply_new_live).
For live-streaming, there is one feature: the bot will react only during the live-streams. If the stream is over, the bot will not see the comments under this stream and will not be able to answer

How to save the comment text to a variable

To save the user comment text, use the comment_text() method
In the Condition box, insert the call client_wall_reply_new, and in the "Calculator" field assign the variable comm (you can take any other name)
comm = comment_text()
Example:

How to Customize Auto Reply to a Comment in Direct

Automatic response to comment DOES NOT open 24-hour window
Copy the callback and move to the pipeline section. Create a block of type "Primary condition check" or "No condition state" and insert the copied callback into the condition. Check "by the presence of keywords"
In the reply box, write the text you want to send in response to this comment
Press "Done". Now, if the user leaves a comment under a specific post with the words "Salebot", he will receive the answer to the direct:
The communication is said to have come in response to the comment. If you click on "View publication", you will be transferred to the post that was commented.
If a user has left a comment that you have not configured a reaction to (or you haven’t configured it at all), you can reply with a single message to the Direct via the "Customers" section
In this case, if we write to the user again at the Direct, the second message will not be sent, because the response to comments does not open the 24-hour window.
You can customize the responses to the keywords you need and send the necessary information to the Direct.
In order for the bot to send a message to the Header in response to any comment under a particular post, in the field "Condition", insert the callback without the comment text:
If you leave only client_wall_reply_new in the "Condition" field, then your message will come to the header in response to comments under all posts (and no matter what text the user wrote)
If you in the "Condition" field leave client_wall_reply_new and keyword, then your message will come to the direct in response to comments with a keyword under all posts.

How to Customize Answers in Direct: Reactions to Stories

When someone sends a response or comment in response to your stories, a message of the type appears in the Customers section
First there is a message that is sent (or emoji), then a link to the stories.
If you want to customize the response to any particular reaction of this stories, you need to copy the link part up to the &
Then go to the pipeline section and create the Primary condition check or No condition block. In the "Condition" field, insert the copied text, and in the reply field, insert the text that will come to the direct.
If you want to configure the answer to a specific word, you specify the word before the copied link. In the answer box write the desired text
First there is a message that is sent (or emoji), then a link to the stories.
If you need to configure the same reactions for any of your stories, you should copy this part of the link:
and further configure the block as described one

How to Customize Answers in Direct: Story mentions

When you are mentioned in the stories, comes the callback of the kind
where the link is a link to the story where you were mentioned.
To configure the responses to the Stories mention, go to the Pipelines section and create the Primary condition check or No condition condition condition block. In the field "Condition" you write "mention_ in _stories", and in the field for the answer you write the text that will come to the direct.
You can also send pictures or links with the text (for example, to give a bonus for mentioning your account)
And then when you mention to the stories user will receive a message:

How to use the account mentions

Account mention in the post

When a user marks your profile in his post, your bot will have a callback:
And there are variables:
mention_caption - post text
post_url - link to post
mention_comments_count - number of comments
mention_like_count - the number of likes
mention_media_id - post id
Set up a response to the mention.
To do this, we create the block "Primary Condition Check" or "No Condition". In the "Condition" field, specify mention_in_media and set the match type "By the presence of keywords"
In the field "Calculator" write the following method:
reply_to_mention(text)
where text is the text of the comment that will appear under this post. You can specify a variable (insert in brackets without quotation marks) or text (quote marks).
Example:
Result:

Mention your profile in comments under posts

When one of the users marks your account in the comments, in the dialogue will come the callback:
If your account is registered in a private profile, you won't get a callback.
Also in the customer card will appear variables:
mention_like_count - the number of likes
mention_media_id - post id

Adjust the response to the reference in the comment.

To do this, create the block "Primary condition check" or "No condition". In the "Condition" field, specify mention_in_comment and type the match type "By the presence of keywords"
In the field "Calculator" write the following method:
reply_to_mention(text)
where text is the text of the comment that will appear in response to the comment. You can specify a variable (insert in brackets without quotation marks) or text (quote marks).
Example:
If the dialogue with the user does not open a 24-hour window, then write to the direct in response to the mention of nothing! Only a reply comment
If the 24-hour window is open, then in the Reply box you can write the text that users will get to the direct after you mark your account.

Mentioning other people’s profiles in comments under your posts

If a person is marked under your account, the mentioned_in_comment variable is created in the customer card. it writes the login of the one who was marked. if more than 2 people are marked, the logins are written to the array:
If you need to segment those who mentioned 2 or more friends, you can assign a variable len = arr_len(mentioned_in_comment) and further compare the variable with the desired value.
If the dialogue with the user does not open a 24-hour window, then write to the direct in response to the mention of nothing! Only a reply comment
How to make such carousel in the guide:
Instagram supports up to 10 cards in the carousel
Consider on the example of a carousel of 3 cards. To create cards you need in the field "Calculator" write the following
p = [{"title":"title", "description": "description 1", "image": "picture link 1", "buttons":[{"text":"text button 1"}]},{"title":"title", "description": "description 2", "image": "picture link 2", "buttons":[{"text":"text button 2"}]}, {"title":"title", "description": "description 3", "image": "picture link 3", "buttons":[{"text":"text button 3"}]}] r = send_carousel(p, '')
That is, first we write the array from title, description, image, buttons to the variable p (you can call the variable otherwise), and then we use it in send_carousel(p, ')
You can use the panel and just insert the desired values of headers, links, etc, and then just copy to your block https://docs.google.com/spreadsheets/d/1ffn0WcA3jr_yE_aO4qE-CRvIIPMNSE8r/edit?usp=sharing&ouid=101088401881429707584&rtpof=true&sd=true
In the field "Message text" leave #{none}
In the buttons of the cards of the carousel you can insert links, then when you click on the button the user will follow the link
To insert a link in the button on the card, write in the array so (on the example of one card)
p = [{"title":"title", "description": "description 1", "image": "link for picture 1", "buttons":[{"text":"text for button 1", "url":"link for button" }]}]
The Carousel buttons include another payload option that will not be displayed to the customer, but will allow you to analyze the customer's choice
Since it is often necessary to place cards with the same button text, another payload parameter has been added, which will not be displayed to the customer, but will allow to analyze their choice:
Note the correctness of its request:
p = [{"title":"title", "description": "description 1", "image": "link to picture 1", "buttons":[{"text":"text of button 1","payload":"1"}]},{"title":"заголовок", "description": "description 2", "image": "link to picture 2", "buttons":[{"text":"text of button 2","payload":"2"}]}, {"title":"заголовок", "description": "description 3", "image": "link to picture 3", "buttons":[{"text":"text of button 3"}]}]
The payload parameter is optional and can be omitted as shown in the figure

How to Like the Last User's Message

To like the last user message, in the "Calculator" field, enter the following function:
like_client_message()
Then when you switch to this block the user will get liked on the last message sent to him.

What are the limitations

If the user removes the message, it will also disappear from the Salebot interface
Group correspondence (interviews with more than two participants) is not supported.
If you see this message, the customer sent you someone’s tape or sent you someone else’s story.

24 hour window

You can communicate with the customer within a week after his last message.
Outside of 24 messages are sent without buttons. To do this, we mark all messages sent after the 24-hour window with the HUMAN_AGENT tag. The tag allows operators to respond to user requests. Messages can be sent within seven days of the user’s message.
Allowed:
  • Operator support for issues that cannot be resolved through a standard correspondence window (for example, if the company is closed for the weekend or if it takes more than 24 hours to resolve the issue)
Prohibited (not complete list)
  • Automatic Messages
  • Content not related to the user request

How to simultaneously use Unofficial and Official Instagram

The best way to use Instagram in messenger marketing is to simultaneously connect gray and official Instagram.
In this case, one dialog is created, which within 24 windows works through the official api, after the message is sent through an informal connection. It’s like you’re sending a text from your phone with your hands.
In order for bots to work simultaneously and not duplicate clients and messages, when connecting gray Instagram it is necessary to specify the login identical to that of the connected official Instagram. Including the case letters!
Within the 24 window, the bot writes with the official API, after the message is sent via an informal connection.
If you disable the official Instagram, messages will automatically be sent from the unoficcial one

How to find out more about your customers: verification and number of subscribers

When a user writes to a bot, the following, verified, and followers variables are displayed in the customer card.
The follow variable is the subscription check. It accepts the True value if the customer subscribes to the account, False - if not signed and None if the client account is closed
verified specifies whether the user has verification (check box of the account). Accepts the True value if there is verification, and False if there is none
followers indicates the number of subscribers at the customers

How to Like User's messages

like_client_message() - like the last user message. Insert this into the calculator field.
Any questions? Look here, maybe your question already has an answer
Copy link
On this page
How to Create a Link to the Direct
How to prepare an account
How to Connect a Chatbot
How to Use the Buttons
How to Use the Atachments
How to Set Ice Breakers
How to check your account subscription
How to Use the Comments on Instagram
How to use the links to Instagram posts working with comments
How to use callbacks working with comments
How to set up an automatic response to a comment under a post or live-stream
How to save the comment text to a variable
How to Customize Auto Reply to a Comment in Direct
How to Customize Answers in Direct: Reactions to Stories
How to Customize Answers in Direct: Story mentions
How to use the account mentions
Mention your profile in comments under posts
How to Create a Carousel
How to Like the Last User's Message
What are the limitations
How to simultaneously use Unofficial and Official Instagram
How to find out more about your customers: verification and number of subscribers
How to Like User's messages