gpt4 book ai didi

google-ads-api - 无法通过 Java 设置 Adwods API,最后一步出现几个错误

转载 作者:行者123 更新时间:2023-12-02 02:57:11 30 4
gpt4 key购买 nike

我正在尝试通过 Java 设置 Adwords API,所有步骤都进行得很顺利,但在最后一步运行 GetCampaigns.java 时,出现了几个错误

"Exception in thread "main" com.google.api.ads.common.lib.exception.OAuthException: Credential could not be refreshed. at com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:240) at adwords.axis.v201705.basicoperations.GetCampaigns.main(GetCampaigns.java:46) Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "invalid_grant" } at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105) at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287) at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307) at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570) at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:362) at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489) at com.google.api.ads.common.lib.auth.OAuth2Helper.callRefreshToken(OAuth2Helper.java:69) at com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:234) ... 1 more"

在此错误消息之后,它没有通过。

最佳答案

这看起来像是您的刷新 token 有问题。您是否生成了刷新 token ?

我通常运行此文件以生成刷新 token 。

https://github.com/googleads/googleads-java-lib/blob/master/examples/adwords_axis/src/main/java/adwords/axis/auth/GetRefreshToken.java

您是否将刷新 token 复制到您的 ads.properties 文件中?

关于google-ads-api - 无法通过 Java 设置 Adwods API,最后一步出现几个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48681788/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com