Ponf
Ponf

Reputation: 1190

Facebook Graph API - get comments hierarchy for URL

I'm trying to implement Facebook Comments Widget functionality in my iOS app using Graph API. How to get ALL comments in right order without user authentication and retrieving access_token?

I know, that I can use

https://graph.facebook.com/comments?id=<my-url>

to retrieve comments, but this method will return only root (first level) comments. I can add parameter filter=stream

https://graph.facebook.com/comments?id=<my-url>&filter=stream

and in this case I will receive all comments, but I can't identify which of them are root and parent IDs of nested comments.

Any ideas how to get all comment in right order?

Upvotes: 1

Views: 1312

Answers (1)

Ponf
Ponf

Reputation: 1190

I found additional parameters, which allows to include parent_id in response:

https://graph.facebook.com/comments?id=<my-url>&filter=stream&fields=parent.fields(id),message,from,likes,created_time

I hope someone will find it helpful.

Reference: Get (Identify) Replies to Comments Using the Graph API

Upvotes: 3

Related Questions