Can i pull events from a facebook page using REST API - facebook

I want to pull events from any facebook page(given a page id) using REST Api. I am writing a server application and there is not facebook user login that we are using.

You could do this with an eternal Page Access Token via the /{page_id}/events edge.
See
https://developers.facebook.com/docs/graph-api/reference/page/events/

Related

Use Facebook Graph API to disconnect a Facebook Page from a Facebook App

I have a website with a Facebook App that allows Facebook users to connect their Facebook pages to the App so that the website can use that Page in different ways.
But I cannot find a way to disconnect the Facebook Page from the App using a Facebook API (probably the Graph API?). The problem is that Facebook keeps sending webhook events as long as the Page is connected to the app.
Is there such a call?
That's done via the subscribed_apps edge on the page. Same as you can add a subscription via this, you can also remove it again.
https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps/#Deleting

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!

Automatically subscribe pages to messenger webhook

I am working on a messenger platform that uses a messenger webhook to receive messages, and the Graph API to send messages. I currently need to go into my app settings and choose to subscribe pages that I already own.
I am wondering how I can subscribe pages that I don't own to my webhook. Is this possible if I have the Page Access Token? I can build an OAuth2 flow to get the Page Access Token, but I don't see what to do with it once I have it.
Any help is appreciated.
This can be achieved by making a POST call to /{page-id}/subscribed_apps endpoint with your Page Access Token.
API reference docs are at https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps/

Connecting third party Facebook page via messenger api

I have an application that uses the Facebook messenger api to send and receive messages through a Facebook page. This works great. Now I need to be able to have a user in my application link their page so that messages sent to their page will send webhooks to our endpoint, and also give us the ability to send messages through that page using an auth_token.
Is there any way to do this via api, or will each user have to manually create a Facebook app, generate an auth_token for their page, and set the webhooks url to our endpoint? I've read about messenger account linking but I don't think it's quite what I need, as I'm not just looking to request additional profile information.
After looking a bit deeper, I found that in order to do this you must perform an OAuth flow to get an auth_token for the user, then use the graph api to get an auth_token for the desired user's page. Then with the page auth_token you can make a POST request to the subscribed_apps endpoint, which will then add the page to the app's webhook events.

Querying Facebook Status Updates of a profile

I have a website that query Facebook graphApi and get the available public data of pages.
I have some profiles, where graphApi does not return any data i.e. post/status data marked public on profile.
Even when I try to visit profile manually i.e. by typing url in IE - https://www.facebook.com/ndalloul, it redirects me to Facebook login page.
But when I do it manually i.e. login to my Facebook Account and try to view the profile Ex:https://www.facebook.com/ndalloul shows me the data marked as public.
How to get this data from Facebook using API or Library?
Any help is appreciated.
Thanks.
Apart from the fact that Facebook is switching to the Graph API 2.0, you should not get any kind of redirect to login if you use your app access tokens and talk to the graph via cURL 8ro qeuivalent) .
The endpoint to get public statuses from fan pages, is page_id/feed/ You need an access token from an app with with read_stream permission and only those who grant you that permission will show the latest posts. More info here
You may now have to be approved by facebook to read the stream, by the way.