Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported get request. Please read the Graph API documentation #36

Closed
cornernote opened this issue Nov 25, 2014 · 4 comments
Closed

Comments

@cornernote
Copy link

Here is my example code:

\FacebookAds\Api::init($app_id, $app_secret, $access_token);
$account = (new \FacebookAds\Object\AdAccount($account_id))->read(array(
    \FacebookAds\Object\Fields\AdAccountFields::ID,
    \FacebookAds\Object\Fields\AdAccountFields::NAME,
    \FacebookAds\Object\Fields\AdAccountFields::ACCOUNT_STATUS
));

Gives the following error:
FacebookAds\Http\Exception\AuthorizationException
Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

I thought perhaps my access_token had expired, so I followed these steps:

I tried with the new access token but got the same message.

@cornernote
Copy link
Author

Also, as per last time you helped you advised me to check something, so I thought I should check again this time...

I went here:
https://developers.facebook.com/tools/explorer/

I choose my application then in the request box put me/adaccounts?fields=name and then click Submit.

Some data came back without any error.

@paulbain
Copy link
Contributor

what format is the $account_id in that you are using? It needs to be prefixed with 'act_'.

@cornernote
Copy link
Author

Yep, that was the issue. Thanks.

@timothymarois
Copy link

@cornernote This needs to be explained in the documentation. I just came across this issue wasting an hour trying to figure it out. Honestly, it shouldn't even be a problem. Just build a check in the method. Let the whole thing come crumbling down because you didn't append a string to an integer, stupid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants