How to use instagram as a chatbot and i already use facebook messenger for the same - facebook

I created an app for my chatbot application and integrate it on Facebook messenger this works perfectly, Now I want to integrate the same on Instagram so I created the business account named "test_MyApplicationName" and then connect it with the same Facebook app which I use for messenger. also created a webhook and give all permissions which are necessary for IG but still, I don't get any response from Instagram messaging to my backend(I also added the recipient/test user in the app). So
I request to you guys please help me to achieve this.
For Instagram is it necessary to have a live/verified app?
Thanks
Kartikey Gupta

You must use a test account for that.
Go to app dashboard-> roles -> test user.
create a test user with pages_metadata, instagram_basic, pages_messaging, instagram_messaging permission.
after creating a test account, log in with that. Create a Facebook page after that go to Instagram open an account using Facebook.
• test in the account should start with test_ example:
test_albert, test_username.
• goto facebook page setting -> Instagram -> connect to Instagram
• go to Instagram settings -> privacy -> Allow access to the message should turn on.
• Connect your app again with the test Facebook account and select the Instagram account while connecting.
P.S: you must have followers between 1-100k to receive an Instagram webhook event from that particular account.

Related

Facebook Messenger Id

I am developing a flutter application where I want to use Facebook Messenger app for user to user chatting. I am using Facebook login+Firebase Authentication for authenticating my users. I am now rummaging through the Graph API to find a way to get the user's ID (not app-scoped, the universal one). I am going to use the Id to finally launch the messenger app as mentioned in the accepted answer of this question. So please help me find way to launch the messenger app with the link of the user's messenger ID.
If it is not possible with facebook messenger, please mention any third party popular chat application that will register + authenticate my users and help me with the chat.

New connect Instagram feature using Instagram graph API

My requirement is to add the feature of Instagram connect and fetch their post/medias.
So I am referring this link Instagram APIs for Instagram connect feature in my android app to fetch user posts of Instagram. as written in document Instagram developer APIs are going to deprecated in early 2020. so I read this new link Instagram Graph API of Instagram graph APIs.
So the problem is I am uncleared with the flow of connect Instagram feature using graph APIs.
So below are my queries:
If I need to connect Instagram and want to fetch their post/media
Do we need to authenticate with Instagram or Facebook?
What will be the flow of it for the user experience?
And all the user that want to connect with Instagram. they have to create Facebook page and link Instagram account to Facebook page?
Or we only need to configure developer account with these steps Instagram Graph API
Thanks
Happy Coding....
The "old" Instagram API is going to be deprecated soon. You should use Facebook Graph API instead. However you need to keep in mind that at the moment Facebook Graph API supports only Instagram Business Accounts. It is not possible to fetch Instagram posts for "regular" Instagram accounts. If you need to support both, you have to apply for both APIs - Instagram API and Facebook Graph API.
With old API you need to authenticate via Instagram login flow. With new Graph API you need to go via Facebook login.
User needs to connect his/her account to your app. Depends on API you are planning to use, but user will have to go either through Instagram (regular accounts) or Facebook (business accounts) and approve access for your app to their content.
Yes, if you plan to use Facebook and Graph API. The requirement for Instagram Business Account is to have Facebook page connected to Instagram account. It is not required for regular accounts and Instagram old API. However you can also access business accounts from old API too;)
It really depends on your use-case. If this is only internal app and you plan to support your personal Instagram account, you cna basically configure the developer account only. But if you plan to release the app to global account you need to go through verification process and app review on Facebook.

How to subscribe facebook test pages to facebook apps webhook

I am creating chatbot and want to connect on facebook.
I want to test my messenger chatbot in my page, but I must do app review and business verification first and I don't want to do that since I just developed my chatbot (or you can say this is staging environment).
I found that we can create test users, test pages, and test apps. I already create them all, but I cannot find a way to subscribe webhook from my test app to my test pages.
only real page appear in that select a page box.
How to subscribe my webhook to my test page? or is there any other way I can chat to my pages to test my chatbot without using business verification first?
Unfortunately, Facebook test apps / test pages / test users is buggy and seem to not work as expected. (I spent a few hours trying to figure that out)
They seem to focus on real user accounts.
We do not need to do business verification when Status of the app is: In Development
HINT: You can create a real user account in Facebook with any anonymous "false identity" name - so that your identity feels more anonymous and all the pages attached to it - whether published or not. (RISKS: But do not forget your password for this FB account, as you will not be able to recover this "second" FB account, as they might require your passport with that false identity "name" for recovery)
Then - you can create page by admin from real app in Facebook for Developers: Settings -> Advanced -> App Page -> Create Page
And then - just connect your bot to Webhooks in a standard way.
I struggled with this all day. Hopefully this can help someone out.
Here are the steps I took to get the interaction from a test user -> test page -> chatbot to work:
Create a test user within your developers.facebook App Dashboard (Roles, Test Users)
Login with the test user and create a page (Test Users -> Edit -> Login with this test user)
Get a long-lived page access token that has the scopes:
pages_messaging
pages_show_list
pages_manage_metadata
pages_messaging_subscriptions (this is needed to register the webhook)
Use the page access token to programmatically register a webhook for the test page (don't think you can manually add from the dashboard):
POST to https://graph.facebook.com/v9.0/{testPageId}/subscribed_apps?subscribed_fields=messages,messaging_postbacks&access_token={longlivedPageAccessToken}
note: using graphAPI 9.0 for all requests

Do I have to create an app using the original Instagram API before i can use the instagram graph API?

I'm trying to create an app with the new Graph API for instagram business accounts.
I am following the documentation here
It says after adding Facebook login, I need to submit the app for review to be able to use the api, and I need to create a screencast on how the app will be used.
Am I looking at the wrong documentation? How am I suppose to create the app without being able to pull any data from the API?
Is there no sandbox mode until the app is developed that I can use?
Do I have to create an app using the Instagram API first to be able to request permissions to use it?
While I haven’t had any experience in Instagram apps, I do have a bit of Graph API experience with Facebook
While in development (a switch at the top of the App Dashboard), any developers and administrators can test the app using any and all permissions. To make the app public however you need to submit for review.
The new instagram graph API is an extension of the existing Facebook API.
So you can make requests on the new API by have a facebook login on your app, then requesting access for the users pages and the users instagram data.
Once you are able to access their pages data you can submit a get request and fetch ?fields=instagram_business_account
once you get the instagram accounts ID, you can make requests on it following this documentation
In development you can only access your own pages, once you build using your own data then you can submit your app for permissions, and finally you can submit your app for review.

Link facebook messenger with facebook login on app

I have a facebook messenger bot that sends a webhook to my web app. People can login to my app via facebook login.
The first user contact is normally with my facebook bot on which they can create a profile. When they make contact I take their facebook id, name, profile pic, etc.
Users can then login with facebook to my web app to enhance their profile.
My problem is facebook uses different scoped ids for messenger and their login.
How can I recognise if a user has already been on my facebook bot if they use my web app, and vice verca.
I think it has something to do with the business mapping api: https://developers.facebook.com/docs/apps/for-business but I'm struggling to understand how it works.
I am sending a get request using:
GET /me?fields=token_for_business
But the docs do not specify the full url to use. I'm also unsure if you can use this in developer mode.
facebook provides an id-matching api
for the app and pages owned by the same business manager. More informations:
https://developers.facebook.com/docs/messenger-platform/identity/id-matching