How to request permissions for location sub-page? - facebook

I'm working on a project that imports ratings and recommendations for Facebook pages. To do that according to the docs here you need the manage_pages permission.
I'm able to request this permission for regular Facebook pages and then pull the ratings for those pages. However, when it comes to locations that are 'child' pages of a regular page, I can't pull the ratings and can see no way to request the permissions for them.
Attempting to access the ratings of a location with the parent page access token when I have the manage_pages permission for the parent page returns the following error:
{
"error": {
"message": "(#283) Requires manage_pages permission to manage the object",
"type": "OAuthException",
"code": 283,
"fbtrace_id": "GEXG+g4MOSb"
}
}
Accessing the ratings on the parent page works fine.
Trying to call FB.login on the web SDK with profile_selector_ids set to a list of child pages doesn't respect the value and will put the entire list of pages that the user manages irrespective of the value of enable_profile_selector.

This seems to have been because of a bug on Facebook's side. There was a support thread on Facebook Developers where the author couldn't access the ratings endpoint for locations.
When hitting the GET /page_id/ratings endpoint (using the page access_token from GET /locations) we receive a missing manage_page permission error
That thread was closed as of today (2019-06-17) and I am again able to access ratings for locations using the master page's access token.

Related

Post on Facebook Page Using FB Graph API using FB Live but un-reviewed App

I want to post on my own Facebook Page using Graph API.
For this, I have created an App.
When App is in Dev Mode, I am able to post on page using Page Access Token with proper permissions.
However, the problem here is, the post are not visible to public unless I make the App Live. The posts are only visible to Page Admins.
But as I make my App Live, I am getting below exception from FB APIs.
{
"error": {
"message": "(#200) If posting to a group, requires app being installed in the group, and \\\n either publish_to_groups permission with user token, or both pages_read_engagement \\\n and pages_manage_posts permission with page token; If posting to a page, \\\n requires both pages_read_engagement and pages_manage_posts as an admin with \\\n sufficient administrative permission",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "abcdefgh"
}
}
I regenerated the Page Access token after I make my App Live but still above error is coming.
I checked some resources which says that I need to submit my App for review. But I don't want to go through that lengthy process.
So, Is there any otherway with which I can post on facebook page using API without putting my App for review process ? Will any other kind of token (i.e. other than page access token) work here ?
Please note, I want to make sure the posts I make to be visible by everyone and not just page admins.

Graph API doesn't return Page Events with a valid Page Access Token

Due to many Facebook's access policies changes, the question may seem duplicated, but it's not.
My application followed all facebook approval process, and at the moment it has been approved by the "App Review" to get "manage_pages" permission. This allows to obtain a "Page Access Token" which grants the access to the page events, wherever the user is Guest or Host. (Facebook manage_pages)
After switching from Development to Live mode, the /page/events endpoint returns an empty object, with all my granted users, with a valid longlive page access token.
{
"data": [
]
}
Has anyone ever encountered this issue?
Thanks.
Past references about this:
Facebook Graph API does not return Page Events
How can I get the events for a Facebook page?

Cannot read Business Page messages with Facebook Graph API despite appropriate permissions

Last week I requested an app review with Facebook, which has successfully granted me permission to request "read_page_mailboxes" permission for users of my application.
I now have an extended access token which, according to the Graph Explorer tool has properties:
App {app_id}: SAM :. Thinkka
User {user id}: James Hartnoll
Valid: True Scopes read_page_mailboxes, manage_pages, publish_pages, business_management, public_profile
I am trying to read conversations of a business page, using this URL:
https://graph.facebook.com/v2.7/[Page_Id]/conversations?fields=can_reply,id,unread_count,updated_time,subject,snippet,link&access_token=[access_token]
However, when I make the request, the response is:
{
"error": {
"message": "(#298) Requires extended permission: read_mailbox",
"type": "OAuthException",
"code": 298,
"fbtrace_id": "FEHvo/6+z39"
}
}
Now according to the Facebook documentation, here:
https://developers.facebook.com/docs/graph-api/reference/v2.7/page/conversations
I have all the permissions I need (namely read_page_mailboxes).
I have done some research and this question (not mine) on Stack Overflow, sums up fairly well what I am doing.
One answer suggests to try using https://graph.facebook.com/v2.7/me/conversations.... but that results in the same error, and the other answer suggests that read_page_mailboxes need approving.
That permission has been approved though, see the start of this question!
The Facebook change log here: https://developers.facebook.com/docs/apps/changelog#v2_4
Tells me that read_mailbox is deprecated, and reading further into that permission, it seems it would not have been granted anyway according to the App Review request, that permission is not available for Web applications anyway.
So... I am stuck?! I have all the permissions that I am required to have according to the documentation, my token is valid and my "GET" requests are correct, but I need a permission which was deprecated a year ago?!
I've sent this message to Facebook too, but it'll take a few days for them to reply and it's irritating me as this should work apparently!
Anyone here had any experience/solution with this?
**NOTE: ** I am after Business Page messages, NOT, personal ones - for clarity.
You're not using page access token to request,instead you're using user access token.You need to first get page access token via GET /me/accounts or visit getting page access token for more details on that.
Once You have this token you can read page conversation by using the following method in PHP:
$pagemessages = file_get_contents('https://graph.facebook.com/me/conversations?access_token={page-access-token}');
var_dump($pagemessages);
or simply using GET request to above link.
Thanks!

Facebook Business page - Unsupported get request

I have admin access to a Business Facebook page, I created an app under the same account, when I then try to use the Graph API Explorer under that application using the access token generated I get:
get/v2.5/{client-name}/
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
I have full access so I do not know why I am getting a error. This normally works fine when I try it on a standard Facebook page, is there something extra I need to do for Business pages?
Since you are trying with an App Token, i assume that the Page is restricted by age or location. In that case, you have to use a User Token or Page Token of a user who is allowed to see the Page and its content.
More information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Facebook app token not working, but access token works

I have a really weird situation here, and I've looked everywhere through Facebook's documentation with no answers.
I'm trying to get get recent posts from multiple Facebook pages. But one of them keeps crashing. It won't work when I'm using an app token. It works if I'm using access tokens, but those expire, so it'd be better to not use that.
https://graph.facebook.com/norgeshushonefoss/posts?access_token=myAppToken
gives this result:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
While this url gives me the recent posts: https://graph.facebook.com/norgeshus/posts?access_token=myAppToken
I can't see any difference in those two. Are there any page settings that may cause an app token not to authorize for some reason?
If the page has any access restrictions in place (age, location, alcohol-related content), then you can not access any of its info using your app access token.
It needs a user access token for a user that qualifies to see the page (or a page access token).