My first AdWords API ERROR

80 views
Skip to first unread message

Dk Monitor

unread,
Sep 1, 2017, 2:46:44 PM9/1/17
to AdWords API Forum
PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'All of 'clientId', 'clientSecret', and 'refreshToken' must be set when using installed/web application flow.' in /var/www/kamensdush/data/www/dkmonitor.top/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php:204
Stack trace:
#0 /var/www/kamensdush/data/www/dkmonitor.top/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php(158): Google\AdsApi\Common\OAuth2TokenBuilder->validate()
#1 /var/www/kamensdush/data/www/dkmonitor.top/examples/AdWords/v201705/BasicOperations/GetCampaigns.php(77): Google\AdsApi\Common\OAuth2TokenBuilder->build()
#2 /var/www/kamensdush/data/www/dkmonitor.top/examples/AdWords/v201705/BasicOperations/GetCampaigns.php(89): Google\AdsApi\Examples\AdWords\v201705\BasicOperations\GetCampaigns::main()
#3 {main}
  thrown in /var/www/kamensdush/data/www/dkmonitor.top/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php on line 204

Shwetha Vastrad (AdWords API Team)

unread,
Sep 1, 2017, 3:26:31 PM9/1/17
to AdWords API Forum
Hi, 

You need to provide your OAuth2 credentials (clientId, clientSecret and refreshToken) in the adsapi_php.ini file and then run the examples. Please see this guide for more details. 

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages