谷歌的技术人员你好:

我们在使用GoogleAds 
php客户端库时遇到了invalid_grant的错误,我们已经获取了refreshToken,并将clientId,clientSecret,developerToken,customerId,refreshToken都已经配置到了google_ads_php.ini中,google_ads_php.ini配置文件也已经存放在当前用户的home目录下。
我们在调用php客户端库中的例子程序GetCampaigns.php时,遇到了如下错误

[root@iZj6cjfcqhdx9dq7v068syZ BasicOperations]# php GetCampaigns.php 
--customerId=8989099376
PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client 
error: `POST https://oauth2.googleapis.com/token` resulted in a `400 Bad 
Request` response:
{
  "error": "invalid_grant",
  "error_description": "Bad Request"
}
 in 
/home/gg/google-ads-php/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/gg/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 /home/gg/google-ads-php/vendor/guzzlehttp/promises/src/Promise.php(204): 
GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/gg/google-ads-php/vendor/guzzlehttp/promises/src/Promise.php(153): 
GuzzleHttp\Promise\Promise::callHandler(1, 
Object(GuzzleHttp\Psr7\Response), NULL)
#3 
/home/gg/google-ads-php/vendor/guzzlehttp/promises/src/TaskQueue.php(48): 
GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /home/gg/google-ads-php/vendor/guzzlehttp/pr in 
/home/gg/google-ads-php/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
 
on line 113


之前也有求助过谷歌技术,但也没有解决问题,之前的回复有让我再继续核实一遍quickstart的内容,我也重新确认过,没有发现遗漏的地方,也有技术同学让我打开客户端库的Logging功能,打开后,我调用接口例子程序却没有任何日志记录下来。

上面的错误是发生在我们的生产账户中,我用自己的个人账户创建了一个test 
account,也是用同样的方法配置客户端库,最终可以成功调用接口,下面是我之前用test account调用成功的内容

[root@iZj6cjfcqhdx9dq7v068syZ BasicOperations]# php GetCampaigns.php 
--customerId=3602938739
Campaign with ID 13322273954 and name 'App promotion-App-1' was found.
[2021-06-16T15:03:18.234321+08:00] google-ads.INFO: Request made: Host: 
"googleads.googleapis.com", Method: 
"/google.ads.googleads.v6.services.GoogleAdsService/SearchStream", 
CustomerId: 3602938739, RequestId: "Vb4tDxILqxAYcOq41nZQ3g", IsFault: 0, 
FaultMessage: "None"

所以这也是一个很大的疑问,为什么我们的test 
account可以成功调用接口,而production account却不能调用成功呢?用得还是同样的配置方法,到底是哪里不对呢?

希望能有技术支持可以帮忙解决我们的问题,多谢了!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads 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 on the web visit 
https://groups.google.com/d/msgid/adwords-api/44deb06b-e45c-412d-bc5e-6df79b442c6en%40googlegroups.com.

Reply via email to