Permission denied after changing von AdWords API (Test) to Ads API (Test)

92 views
Skip to first unread message

Benni S.

unread,
Nov 10, 2019, 3:01:12 PM11/10/19
to AdWords API and Google Ads API Forum
I managed to get test access to the Google AdWords API (described here: https://github.com/googleads/googleads-php-lib) by setting up
  • an Ads Manager Account with a developer token (test)
  • a Test Ads Manager Account (with the red label "Test")
  • a Test Client Account (with the red labale "Test")

After Setting Up OAUTH credentials and downloading adwords-examples-41.0.0.tar.gz, I was able to make a test call "GetCampaigns" via terminal. When I set up the laravel project, that was included in the above download, I got noticed that the above approach is deprecated.

Thus, I followed this approach to use the updated library: https://github.com/googleads/google-ads-php/blob/master/README.md


After I run 
php examples/BasicOperations/GetCampaigns.php --customerId XYZXYZXYZX

I get the following: Do I need to completely start over and discard my 3 test accounts?

ApiException was thrown with message '{
    "message": "The caller does not have permission",
    "code": 7,
    "status": "PERMISSION_DENIED",
    "details": [
        {
            "@type": 0,
            "data": "type.googleapis.com\/google.ads.googleads.v2.errors.GoogleAdsFailure"
        },
        {
            "@type": 0,
            "data": [
                {
                    "errorCode": {
                        "authorizationError": "USER_PERMISSION_DENIED"
                    },
                    "message": "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https:\/\/developers.google.com\/google-ads\/api\/docs\/concepts\/call-structure#login-customer-id"
                }
            ]
        }
    ]
}'.

Google Ads API Forum Advisor Prod

unread,
Nov 11, 2019, 10:37:46 AM11/11/19
to ben.s...@gmail.com, adwor...@googlegroups.com

Hi Benni,

 

Thank you for reaching out. Can you please provide the client customer ID of the test manager and test client accounts via reply privately to author? Additionally, which account did you use to make the call to GetCampaigns?

 

Regards,

Mitchell

Google Ads API Team



ref:_00D1U1174p._5001UJaEED:ref

Benni S.

unread,
Nov 17, 2019, 11:30:13 AM11/17/19
to AdWords API and Google Ads API Forum
Thank you adsapiforumadvisor 

I replied to you directly and gave you 
1.) AdManager ID (to get API access and create developer token)
2.) AdManager ID (Test Account w red test label)
3.) Client ID (Test Account w red test label).

However,  if I run the command ( php examples/BasicOperations/GetCampaigns.php --customerId XXXXXXXX ) with my account id 3.) I see the above error. When I run it with my account id 2.) I get nothing back, not even an error

Using the old AdWords test approach ( described here: https://github.com/googleads/googleads-php-lib ) I am still able to get/return the test campaigns.

Thanks,
Ben
Reply all
Reply to author
Forward
0 new messages