My Facebook app uses the graph API to create comments (with the page access token of an user) as a page on its wall posts. The comments will be created successfully.
But if I take a look (as a page admin) at those on Facebook, the author information is not always the same. Sometimes the name of the app and the other times the name of the Facebook user (from which I got the page access token) will be displayed. This is confusing for me, because it seems to be completely random.
Does anyone know the exact behavior when which name will be displayed?
different author information
Related
(I'm aware of this question, but it's outdated to the point of no longer working, so asking again.)
With the Facebook API it used to be that all profile pictures were considered public, and you could get one for anyone without any access tokens like this:
https://graph.facebook.com/4/picture
Now in 2020 it seems that it only works for public images like Zuck there. I have a tool for Facebook page admins that shows a list of people who liked page posts, but when I try to show user pictures in the list they all now come up blank because "This object does not exist or does not support this action".
The docs now say "This document refers to a feature that was removed after Graph API v3.2". But I could not find any more information about this deprecation. Is it now just impossible to show the picture of a user without having a user access token, or has the way to call it just changed?
The feature has not been removed, but now for users that don't have their profiles set as public, you need to provide an access token.
For instance suppose you use the Page API to list all the people who commented on a post. Previously you could show the profile pics of commenters by just linking to https://graph.facebook.com/<UID>/picture. However now you need an access token for that Page, and to then access the pic as https://graph.facebook.com/<UID>/picture?access_token=<TOKEN HERE>.
I have not tested this with apps, but I would assume that also to get the profile pics of app users based on their app-scoped UID, you'd need to include an access token there as well.
I've written a Facebook web application, which is able to post links to the app page feed (as the page) by requesting the page token and doing a post request to the /PAGE_ID Graph REST endpoint. So far, so good, but I'd like to tag the links with their authors as well. When I add the tags parameter to this request with a value of my user id (I am an admin of the page), this works fine. But when I enter another user id (even one that likes the app page), no tagging is done. Does anyone have any experience with this? Some blog post suggest this is not possible using the Graph API, even though this is possible when done manually.
Thanks!
If I understand correctly what you want to do, it is no longer possible with the new version of the Facebook's API (v.2.0).
Refer to this page for more informations.
I have a web page linked to a Facebook application where users can log in by their Facebook account.
I have also a Facebook page for my application where anybody can post.
What I'd like to achieve is the following:
- An ordinary user logs in to my web page using her Facebook account,
- She adds an information to my web page (for example a book name),
- That information is instantly posted to my application Facebook page under page's name (for example "this book is read by someone").
I don't want it to be posted by the user, I don't want it to be posted by myself (admin of the page).
I don't want to mention about the user, it will be anonymous information.
But I couldn't find a way to do it either as JS or PHP.
Any suggestion is welcome.
Many thanks.
You will need to get a page access token. https://developers.facebook.com/docs/facebook-login/access-tokens/
Get it, store it somewhere on your server – and then use it when making the API call to post what the user entered.
I recently set up an HTTP poster that uses cURL, PHP and the Facebook API to post to my page's timeline.
The page is a dedicated #nowplaying page for an online radio station, so the auth token and associated facebook app is only for one user, which is myself.
The poster has been working for a few weeks, but I have only just now realised that only I can see the posts, which (as they appear to me) are made 'as the page'. Other page followers can only see a single manual post I made welcoming people to the page.
I know this might be a super user question, but I have checked all relevant page settings, and the fact that they can see manual posts by the page makes me thing it's an API/Token thing.
Q: Why can't my facebook page visitors see my automated posts?
Here is my page
Here is what I see, and what I want users to
see. Note: notice the little world logo on each post indicating that they are public.
Edit: I'm making the post over http at https://graph.facebook.com/{pageID}/feed...
Previously, Facebook app's could check if a user liked a given page (for fan-gating) by calling the following Graph API method with no special permissions other than basic authentication:
/me/likes/page_id
This would return a data property with the page's details if the user has liked it previously, or an empty array when the user hasn't liked the page.
Seems that this has recently stopped working. Instead, the only way to get this information is, if the user_likes permission had been granted prior.
The same problem is encountered when using
/page_id/members/user_id
Is there any information on what's causing this new behaviour?
I'm guessing here, but the 2nd call you list would imply that the current user had rights to veiw your page's members list. Really the list of people who like a page should be restricted to the page owner although Facebook does show you who of your friends likes the page as well.
As for user liking the page, I've been searching today for the same and this answer seemed to be the best so far:
StackOverflow: Check if user likes page via Graph API