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

Permission error accessing reports as analyst #22

Closed
siegerhansma opened this issue Oct 24, 2014 · 9 comments
Closed

Permission error accessing reports as analyst #22

siegerhansma opened this issue Oct 24, 2014 · 9 comments

Comments

@siegerhansma
Copy link

I'm trying to get reports for a Facebook Ads account. I have successfully made a connection and added my account as an Analyst to the business account.

This is the code I'm using to connect:

$session = $this->facebook->getSession();

        $ads = new Api($session);

        $account = new AdAccount('act_' . Config::get('services.facebook.adAccountId'));

        $fields = array('account_id', 'total_actions', 'spend');

        $params = array(
            'data_columns' => array (
                'account_id',
                'total_actions',
                'spend'
            ),
            'date_preset' => 'last_7_days',
        );


        $reports = $account->getReportsStats($fields, $params);

However I'm getting the following error when making the call:

(#273) This Ads API call requires the user to be admin of the ad account. User xxxxxxxx not admin on ad account xxxxxxxxxxxxxxxxxxxxxxx.

Why would I need to be an admin when I can access the reports from the webinterface with an analyst account?

@siegerhansma
Copy link
Author

Also, I just tried this with my account added as Advertiser and that doesn't work. It seems I can only get reports as admin while there is a role specifically dedicated to reading reports.

I know this isn't an issue with the PHP SDK but with the API in general.

@pruno
Copy link
Contributor

pruno commented Oct 30, 2014

hi @siegerhansma,

unfortunately what's wrong here is the error message:

@siegerhansma
Copy link
Author

Weird, I don't really get what the issue is. Let me just walk you through my set up:

I made an app which is in development mode (because it's private, not sure if that matters) called test. My useraccount is connected to that app with an access token. My user account is also an analyst on an advertising account.

I'm connecting to /act_xxxxxxxxxxxxxxxxxx/reportstats where xxxxxxxxxxxx is the advertising account id and getting that exception. My access token has the ads_management permission. Could you tell me where this could go wrong?

@pruno
Copy link
Contributor

pruno commented Nov 1, 2014

Did you configured the ad account in the app settings?
https://developers.facebook.com/docs/reference/ads-api/access#standard_accounts

@siegerhansma
Copy link
Author

Yes, I have added the advertising Account ID under Authorized Ad Account IDs and my own email under Authorized Advertiser Emails and System User IDs.

@paulbain
Copy link
Contributor

paulbain commented Nov 7, 2014

This sounds odd. Can you please file a bug at http://developers.facebook.com/bugs and let us know the URL of the bug report. Please include in the report an access token and the adaccounts you are testing which can be submitted confidentially.

@paulbain
Copy link
Contributor

as this looks like a bug, closing this out. Please feel free to comment with the bug id if you submitted one on the FB developer site.

@ghost
Copy link

ghost commented Jun 12, 2017

Is this solved? I have the same problem

@shalakhin
Copy link

The same here. Receive the same error message

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

No branches or pull requests

4 participants