facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.18k stars 1.96k forks source link

Calling {page-id}/feed return exception Unknown path components #1021

Open Devportobello opened 6 years ago

Devportobello commented 6 years ago

Hi,

I'm using the 5.x release of PHP SDK,

When calling "/page-id/feed", i'm facing an Exception "Graph returned an error: Unknown path components: /{page-id}/feed"

$client_id = ...
$client_secret = ...
$fb = new Facebook\Facebook([
    'app_id' => $client_id,
    'app_secret' => $client_secret,
    'default_graph_version' => 'v3',
]);

$access_token = ... // @todo: oauth/access_token
$fb->setDefaultAccessToken($access_token);

$pageid = ...
$response = $fb->get('/' . $pageid . '/feed');

My app is in dev mode, with no review

torinnguyen commented 6 years ago

I was facing the same error, but it was because my code manually appends &appsecret_proof= at the back of the URL.