Why is the Instagram Graph API webhook not working - facebook

I am not able to get webhook calls when another user post a comment (with mentions) on another/my media.
Just for testing purposes I set up a ngrok server for my webhook endpoint, which always answers with a 200 and handles the verfication. Before the heavy coding I just wanted to see if the webhook workflow for Instagram is generally working.
I created a Facebook app, an Instagram business account, a Facebook page and linked the page with the Instagram business account. With the information at Webhooks for Instagram I created a page access token with the Graph API Explorer. When I debug the token with the Access Token Debugger, everything looks fine. All needed permissions like manage_pages, pages_show_list, instagram_basic, instagram_manage_comments, instagram_manage_insights, public_profile are there. With the page access token I am able to fetch all informations regarding my linked Instagram business account via the Graph API Explorer.
Also the Instagram product was automatically added to my Facebook app. Test requests, which where send via the app dashboard (Webhooks product), will be received by my ngrok server. But any type of mentions or comments from another or my Instagram account (business or not) on my or other medias will not be received. What am I doing wrong? Do I have to send those comments/mentions from a specific account, since the app is in development mode and there roles in the app?

After speaking with the Facebook support, my confusion has been resolved.
The problem is that the Webhook for the Instagram product does not work without a verified app review. I had been wondering how to record a screencast with my running solution, without running webhooks... Above all, I had wondered why the webhooks in dev mode worked for the product messenger but not for instagram (or others). Apparently, the app review is not about the technical implementation but rather about checking that the implementation complies with the facebook guidelines. Therefor I want to quote the Facebook support:
Messenger does allow page owners and app admins to receive webhooks for their implementations in devmode and is by design. However, this is not the same for instagram or pages. This is just how the product teams have decided to implement it. For app review, you can show a mock process of the flow, using either the test webhook or your own process. The app review is less about technical implementation steps, but just a way to make sure that your app is going to use the permission in a way that follows our guidelines, so mocking the procedure should be fine. The reviewers understand that you do not receive webhooks in dev mode and should take this into consideration.
Consequently, I will now have to submit an app review and for that I have to imitate the webhook.

Related

How do I successfully submit a Facebook App Review for a server-to-server App?

I've written a Python script to pull performance metrics data from the Facebook Graph API for a connected Instagram Business account. It's a script which runs locally and uses my account's credentials.
I've submitted an App Review selecting "No" and "App doesn't use the Facebook Login dialog." for the "Is a Facebook reviewer able to access or login to your app to verify you're using permissions or features according to Facebook Platform Policy?" and "Why isn't a Facebook reviewer able to access or install your app? Select the option(s) that best describe the functionality of your integration." questions.
However, it's been rejected with the following reason given:
"We found that your app's test credentials did not allow us to fully review the content of the app or there were no test credentials provided for us to review. If your test credentials do allow access, check that the account is setup properly to provide us with full access and to allow us to reproduce the use case steps."
I followed the steps from the Server-to-Server App Sample Submission. I've explained why each permission is required and uploaded a screencast of accessing the relevant endpoints.
Is there something I'm missing?

How does one add "integration flow for an end user to connect their Instagram business account(s)" - FB Graph API (For IG) question

We have a simple app that summarizes the total number of mentions your instagram account gets using the IG-User/tags endpoint on the graph api (https://developers.facebook.com/docs/instagram-api/reference/user/tags/)
The pre-requisite of the app is the user has their fb account linked to their IG - Business or IG - Creator account.
Unfortunately every time we've submitted it for review so far it has come back with the same comment from FB:
"Although we were able to login to your app using the Facebook Login authentication, we were unable to test the steps to connect an Instagram business account. As a result, you'll need to implement an integration flow for an end user to connect their Instagram business account(s)"
Now as I understand it there is no way I can get the user to link their IG account to FB or to a FB page using the API. The "link account" action is purely handled using the Instagram app. Or am I missing something here.
Well after 3 weeks of back and forth with multiple seemingly segmented facebook support teams I have been able to get this permission from them.
Turns out that there's an unexplained flow here:
This is verbatim from the information I received from their chat support (but is not found anywhere in the documentation)
"You have needed to provide Test Users on your App Dashboard, grant the test user the Instagram_manage_comments permission and then provide us with the login details. We would then link that to an internal Instagram Business Account."(sic)
The part where they link an internal business account to the test user happens on their end and outside the scope of the app. I confirmed this and even then I failed the review multiple times because apparently the steps to approve IG business permissions have not been standardized yet and sometimes the approver simply doesn't know what needs to be done. It's a strange state of affairs and the answer it seems is to just keep pushing.
I'm having the same problem and looking forward to see some comments to your post since the first day. But I started to think it will never come.
I believe they want a new user to start with minimum permissions (which is the email permission) and add other permission only as they are needed. This requires a mechanism in your app that guide a new user logged in with only email permission to give other permissions (e.g. taping a button that opens up user’s IG business account needs instagram_basic and manage_pages permissions. Or taping “post comment” button needs manage_comments permission.) So your app should open up a window that the user can give permissions when any of these events fires. (or when user decides to take permission(s) back)
This is what I understand from “steps to connect an Instagram business account”.
But I am not sure if my understanding is correct. I would definitely like to hear if you found any solutions.
I'm also having the same problem as you as I'm developing similar service to IGBlade (https://igblade.com) & Social Blade (https://socialblade.com).
I'm beginning the wonder if I should change my app review request so that I would inform Facebook that the permissions my app is requesting work serverside and therefore there's no need to implement an integration flow for an end user to connect their Instagram business account(s) to my app.
Any thoughts?
Here is what I have done to get the approval
Create a Facebook test user with correct permissions
Log in with this user
Create a Facebook Page
Edit settings on Facebook Page and add Instagram Business account (personal one)
Submit Facebook review with both credentials (Facebook test user + personal Instagram user).
Wait for review and do not forget to change your personal Instagram user password after the review.

How to make a messenger chat bot without a facebook app and webhook?

I went through the documentation for creating a chatbot for messenger platform.
All I find there, I need a server, which in the case used as a service for the Facebook platform.
The server also validates the webhook from facebook app.
Now I see, for a chatbot, I need a facebook app, webhook server and definitely a facebook page.
Then I find an application Flow XO, where I only put the page name and the bot is ready.
My question is, how they(flow.xo) can communicate facebook page without a Facebook app(appId, appSecret) and webHook.
My question is, how they can communicate facebook page without a Facebook app(appId, appSecret) and webHook.
They can’t.
They use their server and their app to communicate with the API, on behalf of the users that grant them access to their pages, by providing the necessary permissions when they log in to that app.
Facebook allows to create a Facebook App which integrates multiple chatbots. At Amio, we ask you for permission using Facebook OAuth. When you give us these permissions we send and receive message on your behalf. This allows you to create a chatbot using Amio API without need of creating a Facebook App.
Facebook Page is always needed as this is the entry point of users interacting with your bot. You can check Amio documentation for more detail.

Questions about FB chatbot app review

I have an FB app ready for app review. That app provides basically a chatbot.
I have 2 questions:
1 - Can I set a webhook of a staging bot instance that is connected to a staging core system to which an FB user can authenticate using specific credentials. I ask this because I don't want to provide Production credentials to the FB reviewer.
2 - Can I provide the reviewer with a test FB page, or do I need to provide the final FB page?
In case of affirmative answers to both questions, when I set Production webhook URL and FB page, do I need to resubmit app review?
Thanks
when I set Production webhook URL and FB page, do I need to resubmit app review?
You can change your webhook URL at any time, that doesn’t require review. And what page(s) you subscribe your bot to doesn’t either.
Review is about the functionality your app provides, and how it uses the data it gets access to. Simply switching out the URL you receive the webhook request under, or which page(s) your bot is running on, is not relevant in that regard. That you switch from a test page to a live page after you got it successfully reviewed might rather be the norm than an exception. Plus, your bot can be used on multiple pages, so that you add others later on is also an expected use case.

How do I create multiple Facebook bots with a single platform?

I have a Facebook bot and I have connected it with a Facebook page. However to have it publicly available I have to wait the approval from Facebook.
Not a problem if you have to make one single bot, huge problem if you have to do it on scale level (eg: 100+ bots).
Platform as Chatfuel or Content Api allow you to just select the page you own and connect the bot automatically.
In minutes the bot is publicly available, skipping the review phase (apparently) in Facebook.
I didn’t find any info about that on the Facebook developer guide, there is a sort of internal API not available for everyone? If so how can you request access to that?
Facebook Messenger bots are published for a page (which is the bot identity) using one or more applications (which defines the webhook where messages are sent).
So the application must be reviewed and approved by Facebook. After that, any page can be 'attached' to this application, using the standard Facebook authorization flow in order to get an access token for this page by the approved application.
So Chatfuel and others alreay have their application approved, and now any page can be connected to it.