tmarois / laravel-ads-sdk

PHP SDK for Google Ads, Bing Ads, and Facebook Ads API for Laravel
MIT License
110 stars 42 forks source link

Google Ads: QuotaCheckError.INVALID_TOKEN_HEADER #31

Closed bjoernbieniakiewicz closed 3 years ago

bjoernbieniakiewicz commented 3 years ago

Hi,

I'm getting a Google\AdsApi\AdWords\v201809\cm\ApiException with the Error Message: QuotaCheckError.INVALID_TOKEN_HEADER when I want to list all Google Ads campaigns.

In the ENV I set the ADWORDS_DEVELOPER_TOKEN, ADWORDS_OAUTH2_CLIENT_ID, ADWORDS_OAUTH2_CLIENT_SECRET and ADWORDS_OAUTH2_REFRESH_TOKEN

The Developer Token is generated through the Google Cloud API Console and I activated the Google Ads API.

How can I fix this problem?

Thanks!

timothymarois commented 3 years ago

Hi,

I'm on the go today, but my quick reference to this specific error says

https://developers.google.com/adwords/api/docs/common-errors#QuotaCheckError.INVALID_TOKEN_HEADER

I would check that your credentials allow you to access some part of the API first as it appears something might be wrong with the developer token

bjoernbieniakiewicz commented 3 years ago

Hi,

thank you for your fast feedback. The developer token is taken from google cloud api console is correct? And in my .env file the token, client data, refresh token is enclosed by quotation marks is correct, right?

I already refreshed my developer token in the cloud api console but it also doesn't work.

timothymarois commented 3 years ago

You have the config setup in Laravel? /config/google-ads.php right?

bjoernbieniakiewicz commented 3 years ago

Yes, got it via the php artisan vendor:publish command and then selected the laravel-ads-sdk

timothymarois commented 3 years ago

Awesome, glad it worked! Let me know if you have any questions or feedback. Going to close this for now.