Hello, i'm trying to execute GetCampaigns.php from the google ads api tutorial but i get "error": "unauthorized_client", "error_description": "Unauthorized". this is my log:
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://oauth2.googleapis.com/token` resulted in a `401 Unauthorized` response: { "error": "unauthorized_client", "error_description": "Unauthorized" } in C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 Stack trace: #0 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\guzzle\src\Middleware.php(69): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL) #1 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL) #3 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() #4 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true) #5 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn() #6 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending() #7 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList() #8 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\promises\src\Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending() #9 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\guzzle\src\Client.php(123): GuzzleHttp\Promise\Promise->wait() #10 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\auth\src\HttpHandler\Guzzle6HttpHandler.php(47): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request), Array) #11 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\auth\src\OAuth2.php(544): Google\Auth\HttpHandler\Guzzle6HttpHandler->__invoke(Object(GuzzleHttp\Psr7\Request)) #12 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\auth\src\Credentials\UserRefreshCredentials.php(114): Google\Auth\OAuth2->fetchAuthToken(Object(Google\Auth\HttpHandler\Guzzle7HttpHandler)) #13 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\auth\src\CredentialsLoader.php(214): Google\Auth\Credentials\UserRefreshCredentials->fetchAuthToken(NULL) #14 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\CredentialsWrapper.php(209): Google\Auth\CredentialsLoader->updateMetadata(Array, 'https://googlea...') #15 [internal function]: Google\ApiCore\CredentialsWrapper->Google\ApiCore\{closure}(Object(stdClass)) #16 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\grpc\grpc\src\lib\ServerStreamingCall.php(44): Grpc\Call->startBatch(Array) #17 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\grpc\grpc\src\lib\BaseStub.php(368): Grpc\ServerStreamingCall->start(Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Array) #18 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\grpc\grpc\src\lib\Interceptor.php(58): Grpc\BaseStub->Grpc\{closure}('/google.ads.goo...', Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Array, Array) #19 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\grpc\grpc\src\lib\BaseStub.php(456): Grpc\Interceptor->interceptUnaryStream('/google.ads.goo...', Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Object(Closure), Array, Array) #20 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\src\Google\Ads\GoogleAds\Lib\V11\GoogleAdsLoggingInterceptor.php(86): Grpc\BaseStub->Grpc\{closure}('/google.ads.goo...', Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Array, Array) #21 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\grpc\grpc\src\lib\BaseStub.php(456): Google\Ads\GoogleAds\Lib\V11\GoogleAdsLoggingInterceptor->interceptUnaryStream('/google.ads.goo...', Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Object(Closure), Array, Array) #22 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\grpc\grpc\src\lib\BaseStub.php(593): Grpc\BaseStub->Grpc\{closure}('/google.ads.goo...', Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Array, Array) #23 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\Transport\GrpcTransport.php(205): Grpc\BaseStub->_serverStreamRequest('/google.ads.goo...', Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), Array, Array, Array) #24 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\GapicClientTrait.php(697): Google\ApiCore\Transport\GrpcTransport->startServerStreamingCall(Object(Google\ApiCore\Call), Array) #25 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\Middleware\CredentialsWrapperMiddleware.php(61): Google\Ads\GoogleAds\V11\Services\Gapic\GoogleAdsServiceGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array) #26 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\Middleware\FixedHeaderMiddleware.php(69): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #27 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\Middleware\RetryMiddleware.php(85): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #28 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\Middleware\OptionsFilterMiddleware.php(63): Google\ApiCore\Middleware\RetryMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #29 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\Middleware\FixedHeaderMiddleware.php(69): Google\ApiCore\Middleware\OptionsFilterMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #30 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\src\Google\Ads\GoogleAds\Lib\V11\ServerStreamingGoogleAdsExceptionMiddleware.php(61): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #31 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\src\Google\Ads\GoogleAds\Lib\V11\ServerStreamingGoogleAdsResponseMetadataCallable.php(40): Google\Ads\GoogleAds\Lib\V11\ServerStreamingGoogleAdsExceptionMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #32 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\google\gax\src\GapicClientTrait.php(672): Google\Ads\GoogleAds\Lib\V11\ServerStreamingGoogleAdsResponseMetadataCallable->__invoke(Object(Google\ApiCore\Call), Array) #33 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\src\Google\Ads\GoogleAds\V11\Services\Gapic\GoogleAdsServiceGapicClient.php(521): Google\Ads\GoogleAds\V11\Services\Gapic\GoogleAdsServiceGapicClient->startCall('SearchStream', 'Google\\Ads\\Goog...', Array, Object(Google\Ads\GoogleAds\V11\Services\SearchGoogleAdsStreamRequest), 3) #34 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\GetCampaigns.php(104): Google\Ads\GoogleAds\V11\Services\Gapic\GoogleAdsServiceGapicClient->searchStream(3528704268, 'SELECT campaign...') #35 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\GetCampaigns.php(61): Google\Ads\GoogleAds\Examples\BasicOperations\GetCampaigns::runExample(Object(Google\Ads\GoogleAds\Lib\V11\GoogleAdsClient), 3528704268) #36 C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\GetCampaigns.php(120): Google\Ads\GoogleAds\Examples\BasicOperations\GetCampaigns::main() #37 {main} thrown in C:\Users\thela\Downloads\laragon\www\adsense\try2\google-ads-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113 -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/acc7ecd0-9f6f-46e9-920d-67c79fc411c2n%40googlegroups.com.
