Hello,

I am following the instructions from the Google AdWords API webpage about 
getting everything setup. When I try to fun the example GetCampaigns.php, i 
get the following error:

root@business:/adwords-examples-34.0.0/adwords-examples-34.0.0# php 
examples/AdWords/v201710/BasicOperations/GetCampaigns.php
PHP Fatal error:  Uncaught InvalidArgumentException: All of 'clientId', 
'clientSecret', and 'refreshToken' must be set when using installed/web 
application flow. in /root/vendor/googleads/g:225
Stack trace:
#0 
/root/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php(173):
 
Google\AdsApi\Common\OAuth2TokenBuilder->validate()
#1 
/adwords-examples-34.0.0/adwords-examples-34.0.0/examples/AdWords/v201710/BasicOperations/GetCampaigns.php(81):
 
Google\AdsApi\Common\OAuth2TokenBuilder->build()
#2 
/adwords-examples-34.0.0/adwords-examples-34.0.0/examples/AdWords/v201710/BasicOperations/GetCampaigns.php(90):
 
Google\AdsApi\Examples\AdWords\v201710\BasicOperations\GetCampaigns::main(
#3 {main}

Here is the text in my adsapi_php.ini file:
[ADWORDS]
; Required AdWords API properties. Details can be found at:
; 
https://developers.google.com/adwords/api/docs/guides/basic-concepts#soap_and_xml
developerToken = "................................."
clientCustomerId = "................................"

; Optional. Set a friendly application name identifier.
userAgent = "........................."

; Optional additional AdWords API settings.
; endpoint = "https://adwords.google.com/";
; isPartialFailure = false

; Optional setting for utility usage tracking in the user agent in requests.
; Defaults to true.
; includeUtilitiesInUserAgent = true

[ADWORDS_REPORTING]
; Optional reporting settings.
; isSkipReportHeader = false
; isSkipColumnHeader = false
; isSkipReportSummary = false
; isUseRawEnumValues = false

[OAUTH2]
; Required OAuth2 credentials. Uncomment and fill in the values for the
; appropriate flow based on your use case. See the README for guidance:
; 
https://github.com/googleads/googleads-php-lib/blob/master/README.md#getting-started

; For installed application or web application flow.
clientId = "29..................................m"
clientSecret = "K7........................18"
refreshToken = "1/w8...............V4"


; For service account flow.
; jsonKeyFilePath = "INSERT_ABSOLUTE_PATH_TO_OAUTH2_JSON_KEY_FILE_HERE"
; scopes = "https://www.googleapis.com/auth/adwords";
; impersonatedEmail = "INSERT_EMAIL_OF_ACCOUNT_TO_IMPERSONATE_HERE"

[SOAP]
; Optional SOAP settings. See SoapSettingsBuilder.php for more information.
; compressionLevel = <COMPRESSION_LEVEL>

[CONNECTION]
; Optional proxy settings to be used by requests.
; If you don't have username and password, just specify host and port.
; proxy = "protocol://user:pass@host:port"
; Enable transparent HTTP gzip compression for all reporting requests.
; enableReportingGzip = false

[LOGGING]
; Optional logging settings.
; soapLogFilePath = "path/to/your/soap.log"
; soapLogLevel = "INFO"
; reportDownloaderLogFilePath = "path/to/your/report-downloader.log"
; reportDownloaderLogLevel = "INFO"
; batchJobsUtilLogFilePath = "path/to/your/bjutil.log"
; batchJobsUtilLogLevel = "INFO"

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ca638eeb-60be-4592-b864-8bf714030992%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Setting up G... Lucy Bowe
    • Re: Set... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum

Reply via email to