Hey, I did exactly that, but withOAuth2Credential shows as undefined: namespace Google\Ads\GoogleAds\Examples\Planning; header("Content-type: text/plain; charset=utf-8");
require 'vendor/autoload.php'; use GetOpt\GetOpt; use Google\Ads\GoogleAds\Examples\Utils\ArgumentNames; use Google\Ads\GoogleAds\Examples\Utils\ArgumentParser; use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder; use Google\Ads\GoogleAds\Lib\V18\GoogleAdsClient; use Google\Ads\GoogleAds\Lib\V18\GoogleAdsClientBuilder; use Google\Ads\GoogleAds\Lib\V18\GoogleAdsException; use Google\Ads\GoogleAds\Util\V18\ResourceNames; use Google\Ads\GoogleAds\V18\Common\MonthlySearchVolume; use Google\Ads\GoogleAds\V18\Enums\KeywordPlanCompetitionLevelEnum\ KeywordPlanCompetitionLevel; use Google\Ads\GoogleAds\V18\Enums\KeywordPlanNetworkEnum\KeywordPlanNetwork ; use Google\Ads\GoogleAds\V18\Enums\MonthOfYearEnum\MonthOfYear; use Google\Ads\GoogleAds\V18\Errors\GoogleAdsError; use Google\Ads\GoogleAds\V18\Services\ GenerateKeywordHistoricalMetricsRequest; use Google\Ads\GoogleAds\V18\Services\GenerateKeywordHistoricalMetricsResult ; use Google\ApiCore\ApiException; $oAuth2Credential = (new OAuth2TokenBuilder()) ->fromFile('google_ads_php.ini') ->build(); $googleAdsClient = (new GoogleAdsClientBuilder()) ->fromFile('google_ads_php.ini') ->withOAuth2Credential($oAuth2Credential) ->build(); Tried updating packages, manually downloading them from github, nothing works. piątek, 24 stycznia 2025 o 05:55:58 UTC+1 Google Ads API Forum Advisor napisał(a): > Hi, > > Thank you for reaching out to the Google Ads API support team. > > I would recommend you refer to this guide on 'Make an API call > <https://developers.google.com/google-ads/api/docs/get-started/make-first-call>' > > for the step-by-step instructions on how to make an API call using the PHP > client library. This guide also has information on how to fetch a refresh > token using the credentials.json file that was downloaded after you created > the client ID and client secret. > > I hope this helps. > > > This message is in relation to case > "ref:!00D1U01174p.!5004Q02vGyCT:ref" (ADR-00285700) > > Thanks, > > [image: Google Logo] Google Ads API Team > Feedback > How was our support today? > > [image: rating1] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=5004Q00002vGyCT> > > [image: rating2] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=5004Q00002vGyCT> > > [image: rating3] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=5004Q00002vGyCT> > > [image: rating4] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/formResponse?usp=pp_url&entry.141427034=4&entry.295079254=5004Q00002vGyCT> > > [image: rating5] > <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/formResponse?usp=pp_url&entry.141427034=5&entry.295079254=5004Q00002vGyCT> > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads 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 "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/adwords-api/4c053c1a-b1fa-463b-b15b-d81d5351c29dn%40googlegroups.com.