Instagram Integration with Rasa

Hey, I am unable to connect my bot to Instagram. Is there anyway to integrate the rasa bot to instagram

Hi @afnaan. It looks like instagram has an API for messaging now, but it is just being rolled out:

We are currently in phase 1 of the global rollout of the Instagram Messaging. Instagram accounts with follower count over 10K and under 100K are able to connect to the API. We plan to expand to accounts with between 1K and 100K followers for the next phase in July and include remaining accounts for the last phase by end of Q3. Please check this page for updates and details of the onboarding steps here.

If you have access, you can create a custom channel connector similar to how it is described here. If you end up creating it, this could be an interesting open source contribution, that we might incorporate into Rasa Open Source and maintain with the other channel connectors

3 Likes

hi @tyd. facebook has updated its instagram integration. To me the API looks very similar to the way the facebook messenger works. Is it on your roadmap?

All Instagram business accounts can connect to Messenger API for Instagram as of August 16, 2021.

3 Likes

@rlinke That’s awesome. This is news to me, so it is not on our roadmap in the near term. I created an issue for it here. Maybe you or @afnaan would be willing to pick it up and make an open source contribution for it? I’d be happy to help get some engineers to review the PR :slight_smile:

This is how I would get started to do that:

  1. Read about How to open a PR and contribute code to Rasa Open Source
  2. Watch this video about Building a Custom Communication Channel for Rasa
  3. Read about Custom Connectors in the docs
  4. Take inspiration from an existing channel like the facebook messenger channel
  5. Let us know in the issue that you plan to take it on
4 Likes

Hey,
Sure I will do this, right now I am very busy with personal projects after I complete them I will look into this and try to do this

2 Likes

A custom channel is not required for Instagram. The docs show that you use the existing Facebook Messenger channel. This is done by connecting the Rasa channel to a Facebook page. Integration with Instagram requires it to be linked to a Facebook page.

2 Likes

I think it needs to be an specific instagram connector, the reasons are as follows:

  • Instagram messaging is not a carbon copy of facebook mesenger:
    • there is no getting started option
    • no persistent menus
    • no secondary reciever option as far as I can tell, handout method defaults to inbox.
    • the bot in the IG channel is always listening to the channel and there is no option to not keep listening even when conversation is handed to a human host. In facebook messenger that is the default behaviour (bot stops listening when handed out to human).
    • when a facebook messenger conversation is marked Done in the business dashboard, the conversation gets handed back to the primary reciever (bot) for future interactions, when in instagram conversation, that is not the case, you must wait for the conversation to time out in your app (luckily rasa can handle this).

Some rasa specific problems:

  • Default utterances with buttons defined in the domain don’t get shown in instagram messenger even when instagram does currently suppport buttons.
  • A lot of messages formatted dispatcher.utter_message(text) within custom actions just don’t get to the user in instagram.
  • Lots of warning messages within rasa, about data being an echo from fb app.

Those issues are not present in facebook messenger. In my tests buttons are shown correctly and all messages using dispatcher.utter_message(text) are shown too in facebook messenger interactions. This is what I found, there could be more issues.

yes I can use a tool called InstaZoomHD to save your photos

Lately, more and more people have been asking me about Instagram chatbots. When I opened an online store two years ago, I realized that many people on this platform and users deciding whether to buy a product or not should respond to the message. And so, it would be nice if you had a chatbot on Instagram because then people would be able to send you messages whenever they want. And you can use this opportunity to improve the quality of customer service and increase your sales. I also use the services of 1394TA, which has significantly increased the number of post views and profile attendance.