I am trying to fetch visitor posts from a Facebook page using Facebook Graph API. For more info see this: https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed
According to documentation, I am using this: **/{page-id}/tagged?fields=message,id,created_time,from**
to fetch the public posts in which the page has been tagged.
I am also fetching the user info using "from" field.
I am able to get the post array. Here is the sample response.
{
"data": [
{
"message": "Sample message text...",
"id": "136617136381867_1041817205861851",
"created_time": "2016-01-28T12:13:37+0000",
"from": {
"name": "Annu Chelladurai",
"id": "10152476225064109"
}
}
.
.
.
]
}
I am able to get the user id and user name under "from" key.
How can i get other user info fields like "picture", etc.?
Finally, I got it.. https://developers.facebook.com/docs/graph-api/using-graph-api#fields
We can use nested requests, as explained in the above document.
So the request is modified as
**/tagged?fields=id, created_time, message, from{id, name, picture, location }**
And it works like a charm. It give me the user info and picture url also.
Hope, this will help someone... :)