Google Ads API PHP USER_PERMISSION_DENIED
I have a Basic Access Token for my manager account 1234567890 I also have one account under this manager account: 0987654321
I've then followed the documentation, installed libraries, generate OATH2, refresh token etc and filled the "google_ads_php.ini" fileand then:
I'm trying to run the example code in the google documentation:
$oAuth2Credential = (new OAuth2TokenBuilder()) ->fromFile('/google_ads_php.ini') ->build(); $googleAdsClient = (new GoogleAdsClientBuilder()) ->fromFile('/google_ads_php.ini') ->withOAuth2Credential($oAuth2Credential) ->build(); $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient(); $query = 'SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id'; $stream = $googleAdsServiceClient->searchStream($customerId, $query);
In my google_ads_php.ini, I have this: loginCustomerId = "1234567890"
In the $customerId filed, I have this: "0987654321"
And I'm receiving this error: USER_PERMISSION_DENIED
Also just because I've started becoming crazy I did try all 4 possible combinations:
loginCustomerId = "1234567890" $customerId = "1234567890"
loginCustomerId = "0987654321" $customerId = "0987654321"
loginCustomerId = "0987654321" $customerId = "1234567890"
But I'm receiving this error in all the cases. Any help would be much appreciated