How to get Pages info - facebook-graph-api

Is there any site with info about Manage pages permission within Facebook?
How can I get "pages info" without ManagePages permission?

You can get any page info as long it is public and not restricted to you. Use the page id or the page username through the graph API like this:
https://graph.facebook.com/CocaCola

Related

Do I need permission "Public page content" to read page posts?

At the moment I use the facebook api to read out the posts of public pages via //posts. I use this data to show on a display in the store the latest facebook post that the store placed on their page.
we have a lot stores that use this, but of most pages I don't have an access token so I use the app access token to read it. However I did receive a warning that I need to request the "Public page content" permission. So I requested it but denied with message "We determined that your app's use case for this permission is invalid, or it's not needed to support its core functionality."
I think I needs this permission, I also think this is an allowed use case.
I did explain why I needed the permission, and uploaded a screencast of how the screen looks like.
Am I missing something? or do I not need the permission to read public posts of a page? (Wish the explanation was better why the permission was denied)

Facebook Messenger subscribed apps, page and app access token generation

I am hitting a wall while developing seamless integration of a Facebook page with my bot.
Essentially I want to achieve same integration than Chatfuel or Manychat have, where being logged in with your Facebook account lets you to just choose what page you are connecting to them and you are good to go.
The problem I am facing is generating the proper token in order to bind the selected page to my app (bot). As per Facebook documentation:
When you create a subscribed_apps edge, the page-id you use in endpoint must match the page ID of the page access token used in the API call. The app that the access token is for is installed for the page.
Given the call has no other parameter than the access token, this access token has to be enough for Facebook to:
Authorize the action on the page.
Identify what app is being subscribed to the page.
This is confirmed while using the Facebook Graph API Explorer, where one selects the page and the app to bind and a proper access token is generated:
This token properly works using cURL in the terminal:
$ curl -X POST 'https://graph.facebook.com/v3.0/<MY_APP_ID_HERE>/subscribed_apps?access_token=<TOKEN_PASTED_FROM_GRAPH_API_EXPLORER>'
{"success":true}
With the Facebook Access token debugger (info icon on the left of the access token, then open in Access token tool), it is confirmed that the token knows about both the page and the app that have to be connected.
The question is, how are these page-app related token programmatically produced? I can't seem to find the proper API call in Facebook documentation and it is by all means possible, as Chatfuel and Manychat are doing this.
Thanks in advance for your support Lars Schwarz and community!
Adding some detail to Alex's answer, for it to be more complete.
When subscribing an app to a page, Facebook needs to:
Know what app you are talking about.
Know what page you are talking about.
Know that you have permissions on that page to subscribe an app.
How does Facebook know it all?
1 comes from the fact that Facebook login happens in the context of a page, actually, the Javascript code for Facebook contains your appId:
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0&appId=<YOUR_APP_ID_IS_HERE>&autoLogAppEvents=1';
2 Comes from the page_id in the URL used to subscribe apps to pages:
https://graph.facebook.com/v3.0/YOUR_APP_ID_HERE/subscribed_apps?access_token=YOUR_ACCESS_TOKEN_HERE
3 Comes from the access token, obtained in the context of an APP through Facebook login, that is passed as parameter in the URL used to subscribe apps to pages:
https://graph.facebook.com/v3.0/YOUR_APP_ID_HERE/subscribed_apps?access_token=YOUR_ACCESS_TOKEN_HERE
To do this, you need to put FB Login on your site/customer portal and request pages_messaging and manage_pages permissions. The person that logs in must be a Page Admin.
Once your app has been granted that permission for the page, you can generate a page access token as described here:
https://developers.facebook.com/docs/pages/access-tokens

Obtain page info for page with age restriction

How do you obtain page info via the Graph API if the page is age restricted?
If the page is age restricted, requesting the page info returns no info about the page unless a valid access_token is provided, however Facebook appears not to accept an app access token as I get a 400 error when making the request.
Many Thanks,
Ady
You need to use the access token for a user who's able to see the page; otherwise you'll get a n exception in the response

How do I get an access_token for a Facebook Page?

I've created a dummy page and I'm trying to browse
https://graph.facebook.com/me/accounts?access_token=MY_AUTH_TOKEN
but all I get is an empty answer.
Read the documentation here on facebook and authentication : http://developers.facebook.com/docs/authentication/

Access a Facebook Page from an External Facebook webpage app

I'm building a webpage Facebook app, I need the app to access a Facebook page and access and display user posts from the page. I have admin control of the Facebook page.
How should I go about achieving this: If I add my Facebook app webpage as a App on my Facebook page will it be able to access the information on the Facebook page?
You will have to grant your application the "manage_pages" permission :
https://www.facebook.com/dialog/oauth? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=manage_pages&response_type=token
once you have that permission you can make a request for an access token :
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials
With this access token you can make requests to the graph api as your page...
You can read more here on the authentication documentation. Look for "App login" and "Page login"