Bo Pennings
Bo Pennings

Reputation: 985

Read multiple images from a post Facebook with the Graph feed

Through a lack of good documentation of the Facebook Graph I need your help.

I use this piece of php code to get posts form a Facebook page:

file_get_contents_curl("https://graph.facebook.com/v2.6/$pageFBID/feed?fields=full_picture,message,story,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true)&access_token=".$token);

This call works fine but I want to get all the images, instead of only one. Does someone know how?

Upvotes: 1

Views: 264

Answers (1)

Bo Pennings
Bo Pennings

Reputation: 985

I finnaly found the soluction. You have to add the 'parameter' attachments to the url to get all the images and other media attached to the post, in a large size.

file_get_contents_curl("https://graph.facebook.com/v2.6/$pageFBID/feed?fields=full_picture,attachments,message,story,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true)&access_token=".$token);

Upvotes: 1

Related Questions