How to link to single facebook comment by comment_id - facebook

I'm retrieving Facebook comments using the graph api. This also returns the id of each comment retrieved. I would like to add a direct link to each comment on Facebook, but I can't figure out what URL I should use.
I know that for example to link a profile/user by id I can use
https://facebook.com/{user_id}
What's the URL for a specific comment?

If I understood your question, I think the structure of the URL for any post comment would be:
https://www.facebook.com/[NAME_OF_THE_PAGE]/posts/[POST_NUMBER]?comment_id=[COMMENT_ID]
The words in brackets you need to retrieve through the Graph API.
If for example you need the comment URL of a video you just replace posts with video and put the according video_number
Hope it helps!

Related

Facebook Group Search post without comments

Hi,
As title, in my facebook group, I need to retrieve only post without comments.
I see the search box and notice that searching something will give an url with
`?query=Word%20Search`
and maybe there is a way to search post without comments by url.
Thanks for help!
You must use the Graph API to retrieve data from Facebook. There is example code how to get the group feed in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed#read
You canĀ“t filter by posts without comments, you need to do the filtering on your own after getting the posts.

Facebook API - How to get content of specific comment using Facebook api?

I have been asked to create a Facebook app that reads a Facebook user's news feed.
For now I have found out how to read a Facebook user's news feed via the /[user-id]/home path. My issues is that I don't know how to get the content of a user's comment on a video/photo etc.. For example, when I call the /[user-id]/home path I can see that a user (friend of [user-id]) has made a comment on a "video-post". I can see the "news ID" of the friend's "action" as '[user-id-of-friend]_[id-of-post-commented-on]', but how can I get the ID of the actual comment, which I need to be able to retrieve the content of the actual comment? The comment ID should look something like '[post-id]_[comment-id]' if I am not mistaken. I need the comment ID to get the detailed information about the comment when making a call to the /[post-id]_[comment-id] path.
A possible, slow and tedious, workaround would be to get all the comments of the "video-post" (calling /[post-id]/comments) and iterate through all the comments until I find the comment of the specific user.

Get URL (Link) for facebook post using post ID

I am trying to get a post from a company Facebook page.The link is for an application i developed that feeds of information from another applications database that uses the Facebook API.
i want to create a link eg www.facebook.com/{postID} that will take me to the specific post.I have tried numerous articles and all seem to send me to a 404 page. Please help.
Thanks
My Application uses the facebook api that accepts data related to a facebook page content (i.e posts,photo's,statuses etc).part of the api is that it saves the actual post id pertaining to a post for e.g. 302961133120433_576487772434433 into my applications database.As you may see that the post id has 2 parts separated by an underscore.So i needed to make a url based on this post id.
Solution for the link is:(2 parts of it,first being page id and second being actual post id)
Hope this helps.
You have facebook API doc on post here : https://developers.facebook.com/docs/graph-api/reference/v2.8/post
the URL you want is called "permalink_url" as field name, so the API call to get that link is in this format:
URL = 'https://graph.facebook.com/v2.8/' + postId + '?fields=permalink_url&access_token=' + facebookToken
Here is a screenshot for my testing in FB API explorer.
If you want to get a list of posts on IDs on a particular page, it doesnt seem to be documented but this works:
https://graph.facebook.com/teapartypatriots?fields=posts.id&access_token=<TOKEN>
If anyone only needs to redirect to the post URL, just put the post id after https://www.facebook.com/ and it will be automatically taken to the post.
more information from the official docs https://developers.facebook.com/docs/pages/publishing/

How to make a comment in facebook with attached picture

In facebook site you able to make a comment and attach image to it. Is it possible to do the same things with facebook api?
I have read this facebook for dev link and there is no answer to my question.
If you read the documentation properly, it says-
message is the only parameter in this API call. It should be a string containing the comment text.
So, using the API you can just comment a message to the object using-
POST /{object-id}/comments?
message='This is my message'
, no link/picture could be attached alongwith.
I don't know if it is a recent change in the way Facebook handles this, but if I put the complete url in the comment, Facebook detects it as an image and shows it there (along with the url).
Maybe it's not the cleanest way, but it's a way.

Facebook Graph API get all comments

I've put a Facebook social plugin comments box on my site, in which i specified a Facebook Fanpage, as the comments target.
Now what I want to do is get all comments that are present in the comments box on page my page. I'm using this:
https://graph.facebook.com/comments/?ids=xxx
In place of xxx I placed my fanpage url (displayed comments just from one day even with limit set to 10000) and when this didn't work I tried my page url, which resulted in nothing being displayed.
The correct syntax to read comments from the Facebook Graph API is as follows:
GET /{object-id}/comments
So your URL would look like this:
https://graph.facebook.com/xxx/comments
Here's a live example that looks at comments on Coca-Cola's cover photo:
http://graph.facebook.com/10152297032458306/comments
You can read more about reading comments via the Graph API here.
check this stackOverflow topic
You need to call it from a secure request https and provide an access_token (19292868552_118464504835613 is Facebook post) :
( (19292868552) is the page or group id and (118464504835613) is the post id)
https://graph.facebook.com/19292868552_118464504835613/comments?access_token=XXX
EDIT:
Added the object from the post document. Try clicking the comments connection and then remove the access_token and try and see the difference.