Facebook Api Messenger subscribe webbook programmatically - facebook

In this Facebook docs page we learn how to create a bot for receiving and sending messages through a Facebook Page.
Is there a way to connect between a webhook and a page programatically and not manually?
If my product is a generic bot for Facebook Messenger, I want to be able to register him to pages without asking my clients to grant me an admin permission to their Facebook Page.

In case anyone else still has this problem, in addition to using the app subscription edge and the page subscription edge, you also need the following permissions: manage_pages, pages_messaging, read_page_mailboxes. The page was not showing up for me in the app > messenger settings until I added the read_page_mailboxes permission.

Related

How can I use Facebook Messenger Platform's webhook to subscribe to the Page messages of other users?

I am creating an application using which users will manage their Facebook messenger and post comments on a page. I have implemented the Facebook Login which asks the user for page_messaging permission. I have also configured the webhook and it is working fine.
Now, Facebook documentation states the following
Generate a Page access token to start using the platform APIs. You
will be able to generate an access token for a Page if:
You are one of the Page admins, and
The app has been granted the Page's permission to manage and access Page conversations in Messenger.
So, how can I make my webhook listen to the messages of the page that have granted me permission to manage and access the page? I have looked for hours trying to find this in the documentation. No Luck!

Allowing others to connect their Facebook Page to our App

I created a Facebook app that has a webhook for Facebook Page messages through FB Messenger. Essentially the purpose is to add a bot to our Facebook Pages. We now want to start creating Messenger bots for other business' pages.
Facebook allows us to have our app webhook subscribe to our own FB Pages, but we can't find any way to add another business' FB Page (screenshot below)
How can we make it so that our app can be installed by other businesses to their FB Pages? (so that the bot will work for their pages).
We put our app through the app review process and it was approved, but I only put in my personal information, not the business' information. Could this be a blocker?
You can subscribe pages to / unsubscribe them from your webhook via the page/subscribed_apps API endpoint.
You need to have a page admin login to your app and grant it permission to manage their pages, then you get a page access token, and with that you make the request to subscribe the page to your webhook.

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.

Manage_pages permission for webhooks

We are trying to configure webhooks for one of Facebook page we are managing.
To use webhooks product in our app, we need manage_pages permission.
So, we have created the screencast & submitted for review.
It is being repeatedly rejected saying, 'Please show the Facebook pages managed by your website on your website'
Ours is a server-to-server app. We don't have a website through which we manage this page. We manage that page by logging in to Facebook directly via https://www.facebook.com
How can we get this kind of app (which uses manage_pages permission for webhooks only) reviewed? What are we missing? Can somebody help?

Facebook app - Do i need those permissions?

I created an app for my clients. They uses this app from their website to post on their Facebook Page (and as the Facebook Page).
they use a Facebook Login button to connect to Facebook (with an account that can publish post on the page) from their website,
they complete a form
when the form is submitted, an article is created on the website AND a post is created on the FaceBook Page.
I ask for publish_action permission and manage_page permission when the user connects.
Those permissions need a review from Facebook, so I ask for it but the FB team says that I "only need those permissions when I use a public-facing Login". Is that not the case?
Currently, my app only work when I connect with the account that created the app.
You do need those permissions, but if the App is for your client only you don´t need to get them reviewed. Just add your client as Admin, Developer or Tester of your App and the permissions will work for him without review.