With the new "Reply" to "Comments" feature on Facebook, I've noticed that replies to comments are treated the same as comments. But I was wondering if there is anyway to distinguish the two?
You first have to enable July Breaking Changes from your app advanced settings
Then use the fields parameter with the comments graph API and include the parent.field(id) column with the and also the filter parameter with the stream value. the final result :
{POST_ID}/comments?filter=stream&fields=parent.fields(id),message,from,likes
this should return both comments and replies with the parent element which has the comment id that the reply belongs to
-- update
and for better array arrangement for replies you can use the following to merge replies with the actual comment array you can include comments.summary(true) in the fields parameter
{POST_ID}/comments?limit=0&filter=toplevel&fields=comments.summary(true),message,from,likes
filter parameter is optional
for more info about the fields : http://developers.facebook.com/docs/reference/api/Comment/
and in case you want to do it in FQL, check this post's comments http://developers.facebook.com/blog/post/2013/04/03/new-apis-for-comment-replies/
Yes. You can query each comment object in the Graph API for the value of its parent field. If the comment in question is a reply, then the value of the parent field will be a reference to the parent comment. Otherwise, no value is returned.
Reference here: https://developers.facebook.com/docs/reference/api/Comment/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With