alfonso payra, The problem was the path of the adsapi_php.ini file, I used psr-4 to integrate the ads library into my project. Adding the following lines in composer.json: "psr-4": { "Google\\AdsApi\\": "vendor/googleads/googleads-php-lib/src/Google/AdsApi", }
And in my controller I use the following way: use Google\AdsApi\AdWords\AdWordsServices; use Google\AdsApi\AdWords\AdWordsSession; use .... //Path where the credentials were saved $path=app_path().'/services/google/adwords/adsapi_php.ini'; // Generate a refreshable OAuth2 credential for authentication. $oAuth2Credential = (new OAuth2TokenBuilder()) ->fromFile($path) ->build(); // Construct an API session configured from a properties file and the OAuth2 // credentials above. $session = (new AdWordsSessionBuilder()) ->fromFile($path) ->withOAuth2Credential($oAuth2Credential) ->build(); ... El jueves, 26 de enero de 2017, 16:35:55 (UTC-3), alfonso payra escribió: > > jesus where you able to fix this problem? im getting same error but i did > follow all steps. Im using vagrant with homestead but not using laravel > > El lunes, 26 de diciembre de 2016, 5:01:53 (UTC-3), Jesús Cárdenas > escribió: >> >> >> Hello I need help, I go to the last version of the library and I have >> problems, I work with Laravel 4.2: >> >> I write in console: >> ~$ *cd* *$path/project/* >> vendor/googleads/googleads-php-lib/examples/AdWords/v201609/AccountManagement >> ~$ *php* GetAccountHierarchy.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* $path/project* >> /vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php:179 >> Stack trace: >> #0 >> *$path/project*/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php(134): >> >> Google\AdsApi\Common\OAuth2TokenBuilder->validate() >> #1 >> *$path/project*/vendor/googleads/googleads-php-lib/examples/AdWords/v201609/AccountManagement/GetAccountHierarchy.php(134): >> >> Google\AdsApi\Common\OAuth2TokenBuilder->build() >> #2 >> *$path/project*/vendor/googleads/googleads-php-lib/examples/AdWords/v201609/AccountManagement/GetAccountHierarchy.php(146): >> >> Google\AdsApi\Examples\AdWords\v201609\AccountManagement\GetAccountHierarchy::main() >> #3 {main} >> thrown in >> *$path/project*/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php >> >> on line 179 >> >> Help me! >> >> El miércoles, 21 de diciembre de 2016, 23:38:06 (UTC-3), Thanet Knack >> Praneenararat (AdWords API Team) escribió: >>> >>> Hello ads PHP developers! Today we’re pleased to announce the stable >>> release of the new ads PHP client library. This has been in beta for a >>> while now, is a huge overhaul of the library, and offers a multitude of >>> improvements. Please see our blog post >>> <https://googleadsdeveloper.blogspot.com/2016/12/announcing-new-ads-php-client-library.html> >>> for >>> all the details! >>> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/62c054ff-3507-4c44-aae1-32e97a17f2e1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.