Facebook API: Fetch events from Page as decoded JSON (Object)

<?php $page_id = "xxx"; $app_id = "xxx"; $token = "xxx"; $object = json_decode(file_get_contents("https://graph.facebook.com/".$page_id."/events?access_token=".$token)); // get new token $new_token = "https://developers.facebook.com/tools/explorer/".$app_id."/?method=GET&path=".$page_id."%2Fevents&version=v2.8"; ?> <pre> <?php print_r($object); ?> </pre> <a href="<?php echo $new_token; ?>">Get new token</a>
Facebook v2.8 - Facebook-Page-App required ( https://developers.facebook.com/apps/)

page-id
http://findmyfbid.com

token (App Token)
https://developers.facebook.com/tools/accesstoken/

1 Response

Deprecated since DSGVO

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.