I'm developping a website in which a user gives an url's public facebook post (he is the owner) and my server retrieves the photo attached to that post.
According the facebook doc, I understand that I need to create an app and my server uses the app's credentials to communicate with facebook.
That app needs permission: 'Page Public Content Access' I believe...
My question is: do I need the user's authorization (user access token after login process) to access the photo of the post?
Thanks for your help!
Well I answer my own question to complete #WizKid comment.
Effectively in that case, if it's a user post, user_photos permission is necessary else for a page, Page Public Content Access is necessary.
One important thing to add is about app review: when you ask for permissions or features the use cases of your app must be one of the allowed usage. Permissions: https://developers.facebook.com/docs/facebook-login/permissions and features:
https://developers.facebook.com/docs/apps/features-reference
Related
I want to submit my Facebook app and Page Public Content Access permission for review.
The app uses API v.3.0. To get my permission request reviewed, I need to provide "Details for Page Public Content Access" and, particularly, to create a screencast which demonstrates
How a person logs in with Facebook
How a person sees this feature used in your app
My app is in development mode. When I use the app to request posts of my own page via [https:]//graph.facebook.com/mypageID/posts?access_token=myappID|myappSecret
to make the screencast, API returns Exception : (#10) To use 'Page Public Content Access, your use of this endpoint must be reviewed and approved by Facebook`.
So I cannot demonstrate how the app works to get it reviewed. Basically a deadlock. Is there some bug in FB API ? How can I get this situation fixed?
No, that is not a bug. If your app is not in the public mode, you can access the public content of facebook pages which you or the facebook accounts you added to the Roles are admin of. As mentioned in Facebook Documentation
While you are testing your app and before you submit it for review, your app can only access content on a Page for which the following is true: The person who holds the admin role for the Page also holds an admin, developer, or tester role on the app.
You can read more about it here: https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS
So you basically need to create your own facebook page and use it in the screencast.
PS: make sure your app is in the development mode
I can use Facebook login to login as an admin of the Facebook app that represents my website. Then, I can call this endpoint:
"https://graph.facebook.com/comments/?access_token=".$tokens["access_token"]."&ids=".$source
here, $tokens["access_token"] is an access token provided by the Facebook login process and $source is the URL for which I want to get the comments.
Facebook's API response is this:
To use 'Page Public Content Access', your use of this endpoint must be
reviewed and approved by Facebook. To submit this 'Page Public Content
Access' feature for review please read our documentation on reviewable
features: https://developers.facebook.com/docs/apps/review.
Initiating the review process for my app in the Facebook developer dashboard, the requirement for obtaining access for this is:
Please give them detailed step-by-step instructions for how to see
this permission the same way people using your app would.
And:
We need to see your app using Page Public Content Access so we can
see that it doesn't violate our policies. Upload a video screencast walkthrough using any method, (even recording with your
phone).
(In both cases, the emphasis is mine.)
I can not show what I can not show. I have no access to this endpoint, so I can not show, in action, my site using this endpoint.
What's more, I am the admin of the Facebook app representing the website for which I want to get access to the comments, and want to access the comments through that, my, account, only; I don't want any regular user account to access the comments for the pages on my website.
So, how do I get programmatic access to the Facebook comments made on pages on my website?
My app uses the Facebook dialog sharer and whenever users share one of my links Facebook gives me back the post_id on the redirect page.
Right now, I'm logging the the post_ids to make sure that the posts went through correctly. The problem is, I can't see the posts for most of the shares because of the user's privacy settings.
So, how can I determine whether a post is private or public if I have the post_id? Which api can I refer to and is this even possible?
I think if you request the Post (with your App Access Token) like
GET /{post_id}
and get nothing in return, then you can be sure that the Post is non-public. If it is non-public, you'll also not be able to request the privacy field.
If you're having an User Access Token with read_stream permission in the moment the User is sharing something, you can use this Access Token to request the Post. Then you should also be able to see the privacy field.
I want to connect my web application with the facebook business page. Each time I add a new product to the page I want to post it on facebook wall. I have a facebook application and the page owner username and password. Can I automatically authenticate with the user, pass to facebook and send the post request from server side only? Usually I am logged in with another facebook account when I add products. Also I would like to post when another page user add a product.
You can post to Facebook as a facebook page using the manage_pages permission. You'd need to obtain this permission from a user who is an administrator of the page. There are a few steps to the process, here is a basic summary:
Get an access token from a user who is an administrator of the page
and has granted "manage_pages" to your app. read about authentication
here: http://developers.facebook.com/docs/authentication/
using that access token, make a graph request to
https://graph.facebook.com/me/accounts?access_token=USER_AUTH_TOKEN
You'll get a json response containing all the pages the user administrates, containing their name, category, facebook id, and an auth token - this is what you'll need to post to that page
you can then use this access token to post to the specific page using
https://graph.facebook.com/PAGE_ID/feed?message=POST_MESSAGE&access_token=AUTH_TOKEN&method=post
I just found this blog post which gives you a pretty good explanation
http://developers.facebook.com/blog/post/465/
It sounds like you need the 'offline_access' extended permission.
It is scheduled to be deprecated. Take a look at the following link for more details:
Deprecation of Offline Access Permission
I'm not going to pretend to be an expert on this, but I do NOT recommend trying to login through Facebook's user interface and perform POST requests/HTML scraping on behalf of the user. That procedure would grant you far more functionality than is possible through the Graph API; I don't think Facebook would approve of this.
Is there any way to comment some object on facebook as company page (not from personal account)? We have comment.add method, but I'm not able to give permissions for my app from company page (I have to switch to my personal profile). Any ideas?
Yes you can, you'll have to get an app access_token and use that token when making the post. You can read more here - on the Facebook Authentication Documentation for more information about how to retrieve your app access_token. (Scroll down to App Login)