简体   繁体   中英

Google Adwords API PHP return invalid_client error

starting with google adwords api php , i would like to test the use of the api and while executing the first script in the examples/v201509/BasicOperations/GetCampaigns.php i'm getting this error :

An error has occurred: {
  "error" : "invalid_client",
  "error_description" : "The OAuth client was not found."
}

thanks.

You are not following this steps. 1) Your Client Id and Client Secret need to be same as you have authorized the Application. 2) Your redirect Url needs to be same as oauth2callback.

You can follow this guide for authentication. https://developers.google.com/adwords/api/docs/guides/authentication

Thanks,

For others who will find this thread. To try examples, please read the README.md first https://github.com/googleads/googleads-php-lib/blob/master/README.md

In short: you'll need to specify keys in auth.ini, which library will read during the execution

My working code started to have the same error at 2017-01 with google DFP API when I try to get a new refresh-token, which has the same set up as adwords. That is because the old "Client Id" with "Web application" type for my account does not work any more. And got "401, unauthorized" error from python lib. After creat a new "Client Id" with "Other" type, the error is gone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM