Facebook API, get page post link (PHP)



PHP Snippet 1:

$facebookUrl = 'https://graph.facebook.com/'.$facebookPageId.'/posts?&access_token='.$facebookAppId.'|'.$facebookAppSecret;
$facebookData = json_decode(curlRequest($facebookUrl))->data;

$link = "http:/fb.com/".$facebookData->id; //This short link will redirect to the pages' post

PHP Snippet 2:

https://graph.facebook.com/POST_ID?fields=picture,link&access_token=YOUR_TOKEN

PHP Snippet 3:

{
  "link": "http://example.com/link",
  "picture": "https://example.com/picture",
  "id": POST_ID
}

PHP Snippet 4:

facebook.com/123123123/posts/890890890/

PHP Snippet 5:

facebook.com/{{page_id}}/posts/{{post_id}}/