Get error code when request the API

275 views
Skip to first unread message

HQ

unread,
Aug 4, 2023, 1:52:06 AM8/4/23
to Google Ads API and AdWords API Forum

Hi, I received an error code on the following message when I push data from my CDP to google ads platform, and I’m not sure what to do to solve it. Can someone help me check it out?


Adwords 設定異常:One or more errors occurred. (Status(StatusCode="Internal", Detail="Error starting gRPC call. TokenResponseException: Error:"invalid_grant", Description:"Bad Request", Uri:""", DebugException="Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"invalid_grant", Description:"Bad Request", Uri:""
at Google.Apis.Auth.OAuth2.Responses.TokenResponse.FromHttpResponseAsync(HttpResponseMessage response, IClock clock, ILogger logger)
at Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.ExecuteAsync(TokenRequest request, HttpClient httpClient, String tokenServerUrl, CancellationToken taskCancellationToken, IClock clock, ILogger logger)
at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.FetchTokenAsync(String userId, TokenRequest request, CancellationToken taskCancellationToken)
at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.FetchTokenAsync(String userId, TokenRequest request, CancellationToken taskCancellationToken)
at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.RefreshTokenAsync(String userId, String refreshToken, CancellationToken taskCancellationToken)
at Google.Apis.Auth.OAuth2.UserCredential.RefreshTokenAsync(CancellationToken taskCancellationToken)
at Google.Apis.Auth.OAuth2.TokenRefreshManager.RefreshTokenAsync()
at Google.Apis.Auth.OAuth2.UserCredential.GetAccessTokenWithHeadersForRequestAsync(String authUri, CancellationToken cancellationToken)
at Grpc.Auth.GoogleAuthInterceptors.<>c__DisplayClass3_0.<b__0>d.MoveNext()
at Google.Apis.Auth.OAuth2.TokenRefreshManager.g__LogException|10_0(Task task)
at Grpc.Net.Client.Internal.GrpcProtocolHelpers.ReadCredentialMetadata(DefaultCallCredentialsConfigurator configurator, GrpcChannel channel, HttpRequestMessage message, IMethod method, CallCredentials credentials)
at Grpc.Net.Client.Internal.GrpcCall`2.ReadCredentials(HttpRequestMessage request)
at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)"))

Google Ads API Forum Advisor

unread,
Aug 4, 2023, 4:41:31 AM8/4/23
to mamaw...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Forum.

I can see that you have encountered the common invalid_grant error. This error means the token has expired or revoked. For more information about refresh token expiration, you also may refer to the Refresh token expiration guide. 

That said, you may try generating a new refresh token to resolve this error. To generate a new refresh token you may refer to Get an OAuth2 Refresh Token and Configure Your Client guide.

Let us know how it goes on your end.

Reference links included in this email:

 
This message is in relation to case "ref:_00D1U1174p._5004Q2nawIg:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages