Hi,

I'm trying to get v201708 working and when I try to run GetCampaigns.php I 
get the error message:

PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with 
message 'All of 'clientId', 'clientSecret', and 'refreshToken' must be set 
when using installed/web application flow.' in 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php:204

Here is some info:

I am running XAmpp on Windows 10

I went through the process to get the refreshtoken. That went fine 
ALTHOUGH... it did give me a different one than I have been using in the 
older version that gets retired on October 2nd.

I am currently located 
 
in:C:\DataH\xampp\htdocs\DBGoogleAdwords\examples\AdWords\v201708\BasicOperations>

When I type:php GetCampaigns.php

Here is the screen capture:

C:\DataH\xampp\htdocs\DBGoogleAdwords\examples\AdWords\v201708\BasicOperations>php
 
GetCampaigns.php
PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with 
message 'All of 'clientId', 'clientSecret', and 'refreshToken' must be set 
when using installed/web application flow.' in 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php:204
Stack trace:
#0 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php(158):
 
Google\AdsApi\Common\OAuth2TokenBuilder->validate()
#1 
C:\DataH\xampp\htdocs\DBGoogleAdwords\examples\AdWords\v201708\BasicOperations\GetCampaigns.php(77):
 
Google\AdsApi\Common\OAuth2TokenBuilder->build()
#2 
C:\DataH\xampp\htdocs\DBGoogleAdwords\examples\AdWords\v201708\BasicOperations\GetCampaigns.php(89):
 
Google\AdsApi\Examples\AdWords\v201708\BasicOperations\GetCampaigns::main()
#3 {main}
  thrown in 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php
 
on line 204

Fatal error: Uncaught exception 'InvalidArgumentException' with message 
'All of 'clientId', 'clientSecret', and 'refreshToken' must be set when 
using installed/web application flow.' in 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php:204
Stack trace:
#0 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php(158):
 
Google\AdsApi\Common\OAuth2TokenBuilder->validate()
#1 
C:\DataH\xampp\htdocs\DBGoogleAdwords\examples\AdWords\v201708\BasicOperations\GetCampaigns.php(77):
 
Google\AdsApi\Common\OAuth2TokenBuilder->build()
#2 
C:\DataH\xampp\htdocs\DBGoogleAdwords\examples\AdWords\v201708\BasicOperations\GetCampaigns.php(89):
 
Google\AdsApi\Examples\AdWords\v201708\BasicOperations\GetCampaigns::main()
#3 {main}
  thrown in 
C:\DataH\xampp\htdocs\DBGoogleAdwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\OAuth2TokenBuilder.php
 
on line 204



My adsapi_php.ini is located in c:\Users\MYNAME\ads_php.ini.  (I know this 
is the correct home path because if I rename the file 
 Uncaught exception 'InvalidArgumentException' with message 'Config file 
not found as specified: 'adsapi_php.ini' or in the home directory: 
'C:\Users\MYNAME\adsapi_php.ini'.'


I DID NOT set jsonKeyFilePath in adsapi_php.ini shown below.


Can someone please give me some help?? I've lost a day on this so far!!

Thanks,

..Mike



Below are the contents of the C:\Users\MYNAME\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
;MJE 20170918 developerToken = "INSERT_DEVELOPER_TOKEN_HERE"
developerToken = "LHg9XXXXXXXXXXXXXXXxJA"
;MJE 20170918 clientCustomerId = "INSERT_CLIENT_CUSTOMER_ID_HERE"
clientCustomerId = "1XX-XXX-XXXX"

; Optional. Set a friendly application name identifier.
; userAgent = "INSERT_USER_AGENT_HERE"
userAgent = "GAXXX Other Client"

; 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.
;20170918 MJE  clientId = "INSERT_OAUTH2_CLIENT_ID_HERE"
client_id = 
"225209661262-XXXXXXXXXXXXXXXXXXXXmhet6sdrr3mv.apps.googleusercontent.com"

; 20170918 MJE clientSecret = "INSERT_OAUTH2_CLIENT_SECRET_HERE"
client_secret = "BRmXXXXXXXXXXXXXXXXXXXX3"

; 20170918 MJE refreshToken = "INSERT_OAUTH2_REFRESH_TOKEN_HERE"
;20170920 OLD TOKEN refresh_token = 
"1/LCDoeNRJw48SrIrj4gNPcPjb9r3jTL0_3hO29pOUm_M"
refreshToken = 
"1/EKTGXXXXXXXXXXXXXXXXXXXXXXXXX4RsHZY3KkIn6a1BSMFjd6SJZlj7lx"




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

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

[PROXY]
; Optional proxy settings to be used by SOAP requests.
; host = "<HOST>"
; port = <PORT>
; user = "<USER>"
; password = "<PASSWORD>"

[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/95c3dc00-c8c4-4316-ae2e-6445cfff358a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to