Hi ,
I am using the following authorization to access Google API
GoogleAdsConfig config = new GoogleAdsConfig()
{
OAuth2Mode = Google.Ads.Gax.Config.OAuth2Flow.APPLICATION,
OAuth2ClientId = secrets.ClientId,
OAuth2ClientSecret = secrets.ClientSecret,
OAuth2RefreshToken = credential.Token.RefreshToken
};
GoogleAdsClient GACLient = new GoogleAdsClient();
// Get the AdGroupService.
GoogleAdsServiceClient googleAdsService =
GACLient.GetService(Services.V12.GoogleAdsService);
string searchQuery = "SELECT campaign.id, ad_group.id,
ad_group.name FROM ad_group";
// Retrieve the campaigns.
PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow>
searchPagedResponse =
googleAdsService.Search("XXXXXX", searchQuery);
Even though a refresh token is generated and updated, throwing the
following error, Please suggest.
Status(StatusCode="Internal", Detail="Error starting gRPC call.
TokenResponseException: Error:"invalid_request", Description:"Missing
required parameter: refresh_token", Uri:""",
DebugException="Google.Apis.Auth.OAuth2.Responses.TokenResponseException:
Error:"invalid_request", Description:"Missing required parameter:
refresh_token", 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.TokenRefreshManager.GetAccessTokenForRequestAsync(CancellationToken
cancellationToken)
at
Google.Apis.Auth.OAuth2.UserCredential.GetAccessTokenWithHeadersForRequestAsync(String
authUri, CancellationToken cancellationToken)
at
Grpc.Auth.GoogleAuthInterceptors.<>c__DisplayClass3_0.<<FromCredential>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
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)")
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/70085133-c097-4b97-b950-b0eb04b88645n%40googlegroups.com.