Getting Comments of comments Facebook API

Ad

I have a big problem, im trying to use the Facebook API along with laravel to pull post data and likes, comments etc.

the response object that i get only contains 3 pieces of information

"message" => "Qwerty"
"created_time" => "2015-12-15T13:49:13+0000"
"id" => "156888861027704_904787026237880"

is there not way of pulling more bits of information out? and also say this was a comment and people replied to it, how would i pull all the information out in 1 go i don't want to make two separate requests because that would mean needing to click on each individual comment to see their replies it would be much easier to just get something like this is possible

"message" => "Qwerty"

"replies" => [
    0 => [...],
    1 => [...]
]

"created_time" => "2015-12-15T13:49:13+0000"
"id" => "156888861027704_904787026237880"

There's not much in depth tutorials so any help would be appreciated and please note i am using laravel 5.1 for this!

Ad

Answer

Ad

Example with nested requests:

/page-id/feed?fields=message,comments{message,comments}

This lists comments and subcomments. Also, you need to define the fields you want to get back, it´s called "Declarative Fields": https://developers.facebook.com/docs/apps/changelog#v2_4

Your version of Laravel is irrelevant for this though, it´s only a question about the Graph API.

Ad
source: stackoverflow.com
Ad