Is it possible to access all the comments where a page has been mentioned in (using #pagename)?
I tried using {page-id}/tagged but that only gives me messages that were left on the page itself and not the ones the page has been mentioned in a status or comment on a status.
Thanks in advance
Related
I need a solution where I can unpublish/delete comments on Facebook Ads. There are paid tools which have this feature, like this one:
https://www.agorapulse.com/blog/comments-facebook-dark-unpublished-posts
"Finding and responding to these comments was a major headache, so we
went digging on Facebookâs API and found a solution to include all
comments made on dark/Unpublished posts and we included them in our
unified Facebook Inbox."
With the normal command endpoint I can't get the commands for ads.
How I can access and manage the commands, which API endpoints I need?
There are a few endpoints you'll most likely be interested in:
1) Your ads are connected to a page, so you'll need to get data for your Page. See https://developers.facebook.com/docs/pages/managing for reference.
2) Your page contains the posts. See the section titled "Getting Page Posts" in the link from step 1.
3) The posts contain comments. Using the id of the post, make the appropriate API calls to get its posts. See https://developers.facebook.com/docs/graph-api/reference/v2.9/object/comments/ for reference.
4) Once you find the comment you want to delete, make the appropriate DELETE call on it. See graph-api/reference/v2.9/comment/ for reference.
When I call Graph API as
https://graph.facebook.com/comments/?access_token={TOKEN}&filter=stream&fields=parent.fields(id),message,from&ids={PAGE_CONTAINING_EMBEDDED_FB_COMMENT_BOX}
the results displays the replies as well with "parent" field.
Trying the same for page feeds like:
https://graph.facebook.com/{PAGE_ID}/feed?access_token={TOKEN}&limit=100&fields=parent.fields(id)
I get the "Subfields are not supported by parent" error message.
What is the correct syntax of "fields=" parameter to retrieve all comments with replies for page posts?
Thank you in advance.
To get posts and replies, try this:
fields=from,to,message,picture,link,name,caption,description,created_time,updated_time,likes,comments.limit(999)
To get posts, replies and replies to replies, try this:
fields=from,to,message,link,name,caption,description,created_time,updated_time,likes,comments{from,to,message,link,name,caption,description,created_time,updated_time,like_count,comments{from,to,message,link,name,caption,description,created_time,updated_time,like_count}}
We are looking for a way to find out, if a comment is hidden on a story on a page feed. We are using the Graph API to get the comments: [story_id]/comments with an Admin Access Token. Facebook tells us if we can delete the comment. However, there is no "is_hidden" flag or something.
Is there any other way to find out if the comment is hidden/marked as spam?
Thanks!
I'm PHP Developer, we have also used Facebook Graph API many times.
As per my expertise, I think we cannot fetch/identify only hidden/spam comments.
But yes you can get the comments for only particular user if you want.
For example:
1.) Get id of a fanpage with public graph data: http://graph.facebook.com/cocacola - thumsup has 507267189335315.
2.) Get ThumsUp's "like plugin" iframe display directly with some modified params: http://www.facebook.com/plugins/fan.php?connections=100&id=40796308305
3.) Now check the page sources, there are a lot of fans with links to their profiles, where you can find their profile ids or nicknames
4.) If you are interested only in profile ids use the graph api again - it will give you profile id directly
I hope you will find my answer appropriate.
If you are getting some other solution, please share
Thanks,
Shreyas
By now, finding out if a comment is hidden can be achieved via the is_hidden flag.
More detailed answer on a similar question
Facbook API docs for comment endpoint
I wanna get all input from my pages timeline. so I read graph.facebook.com/pageid/feed with the page token. but some posts are missing - even when I try using FQL
e.g. these are
a user posts to his own wall and marked my page in his status or picture
a user posts to his own wall and mentioned my page as the location for this post
the recommendations
also in /tagged/ these posts won't appear. Is there any chance to get them?
thx
me
No. Facebook shows more within their webapp than they make available via the API. What gets returned depends on the poster's privacy settings.
In my experience, if the post isn't marked "public", then it won't be returned by the API, even if it is visible to you from within the Facebook.
I've recently switch my code to post to facebook from
https://graph.facebook.com/[profile_id]/feed
to
https://graph.facebook.com/[profile_id]/links
Now i'm getting this problem, can anyone help?
- my picture that i accompany with the post is not showing, it look like facebook is defaulting to the first image it find on the link page
http://developers.facebook.com/docs/reference/api/post/
http://developers.facebook.com/docs/reference/api/link/
both of these document allow me to specify a picture, but somehow the "links" one isn't displaying the image.
Thanks in advance
Set correct Open Graph meta tags, especially og:image.
I just resolved similar issue, posted news on website and posted via /links to fanpage resolved in post with wrong image content and "site not found" title.
The issue was related to wrong code sequence. We hooked posting news via fb api in not-so-good place. The post should have been already available but it wasn't and posting to fb api results in immediate request from facebookexternalhit bot to check if it exists. Detailed log analysis shown that ping from facebook was before POST to add news finished, that's why we had messed content there.
Sample content we post, if what I described above is not your case:
content_dict =
{
'picture': 'http://www.czerwonysmok.pl/static/media/uploads/blog/pb_reddragon_all2_poprawiony_czerwony.jpg/',
'message': 'Title \n\n contentcontentcontentcontentcontentcontentcontentcontent ',
'link': 'http://www.czerwony-smok.pl/klub/aktualnosci/rashguard-ze-strony/'}
try:
logger.info("Publishing to facebook: " + str(content_dict))
graph.post(path="%s/links" % settings.FAN_PAGE_ID, **content_dict)
About sharing on my Android app i'm using this code:
Bundle postParams = new Bundle();
postParams.putString("message", "User's custom message above share content");
postParams.putString("name", "The name of the link attachment.");
postParams.putString("description", "The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page.");
postParams.putString("caption","The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.");
postParams.putString("picture","The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on sharing best practices for more information on sizes.");
postParams.putString("link", "The link attached to this post");
Refer to the document for detail: https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.3