I used following code to access facebook page posts.
$accessToken = 'EAAlGssgdgQIBAHuD9ZBZB6RWZClM3bmm8Vjv2nZBNmotTTnubgzdK4aiHbqJwhRlELjAurPEHKSqxJS7c0Pyd5ZBuqZAo2keabbkubx0AZCl3m6brDGlkXNgMq9dtNUZAx4P6QwdsXwNvJaEi2j3YDsHpZABiRxRK6qMAmZAyynLvJNCJ41ZBn9se28QUsDHG72mhZCzHFLpLQUxZCAZDZD';
$id = '109395947376896';
$url = "https://graph.facebook.com/$id/posts?access_token=$accessToken";
$result = file_get_contents($url);
$decoded = json_decode($result, true);
var_dump($decoded);
and get the following result. screenshot is attached
how do I get images of posts??
2
Answers
Without specifying the fields, you will only get default ones. This is how you can get fields (checkout the API docs for Posts about available ones):
Source: https://developers.facebook.com/docs/graph-api/reference/post/#fields
You can get them in field parameters
Also refer https://developers.facebook.com/docs/graph-api/reference/post/