3

I'm trying to validate Facebook App ID and App Secret. With Graph Explorer, I'm able to use access token in shape of {APP_ID}|{APP_SECRET} to get app details on /v2.5/{APP_ID} endpoint.

It doesn't work with PHP SDK though. The error I'm getting is:

Unknown path components: /{APP_ID}

The code I used is this:

$facebook = new Facebook\Facebook( [
    'app_id' => $app_id,
    'app_secret' => $app_secret,
    'default_graph_version' => '2.5',
] );

$facebook->get( '/' . $app_id, $app_id . '|' . $app_secret );

It does the validation, because with invalid app ID I'm getting:

Error validating application. Cannot get application info due to a system error.

And with invalid secret:

Invalid OAuth access token signature.

How can I get the app details just like in graph explorer? I have no idea what I'm doing wrong, the request seems to be correct. Please help.

Robo Robok
  • 21,132
  • 17
  • 68
  • 126

1 Answers1

3

There is a typo in default_graph_version. It needs to be prefixed with v (standing for version), so the correct declaration is:

'default_graph_version' => 'v2.5',
Robo Robok
  • 21,132
  • 17
  • 68
  • 126