According to the documentation the endpoint looks like
GET /debug_token? input_token={input-token}& access_token={access-token}
where
input_token:
the access token you want to get information aboutaccess_token
: your app access token or a valid user access token from a developer of the app
Assuming I don't have a "valid user access token from a developer of the app" - just because I don't want to refresh it every 2 months and keep always it in mind - how would I perform it using "app access token"?
The getApplicationAccessToken()
method is protected, so there is no way to access it without overriding it to public.
Any elegant solution that I'm missing?
PS: a call example that would fail with "You must provide an app access token or a user access token that is an owner or developer of the app" error due to lack of access token:
$tokenDebug = $fb->api('debug_token', array('input_token' => $token,));
PPS: the "interesting" thing is that the error from above would appear not for every $token
but for some, and I cannot see any obvious distinction between tokens that fail and that succeed.
PPPS: $token
is a user access token
PPPPS: Created a feature request for FB PHP SDK https://developers.facebook.com/bugs/637897982899835
PPPPPS: Probably it could be better to create a pull request instead, but it's 1:30am and I'm too tired for that