Hi Heidi,

I added the email for the OAuth2 Client Id/Secret to the Ads Manager Test
account, and now I have an exception error.

I generated a new refresh token using the Ads Manager account and ran it
again, but the exception is the same.

λ dotnet run --framework net5.0 V11.GetCampaigns --customerId xxxxxxxx
Requested: 'V11.GetCampaigns', Loaded: 'V11.GetCampaigns'.
This code example gets all campaigns. To add campaigns, run AddCampaigns.cs.
One or more errors occurred. (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
Grpc.Auth.GoogleAuthInterceptors.<>c__DisplayClass3_0.<<FromCredential>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   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)"))

I can confirm that the required refresh token is already in the app.config.

I followed the instructions for enabling the log, but only got a 0-byte log
file. Might be due to the exception above.

What can I do to further troubleshoot this issue?

Thanks.

Regards
CK

On Tue, Sep 27, 2022 at 8:02 PM Google Ads API Forum Advisor
<adsapi@forumsupport.google> wrote:

> Hi CK,
>
> Thank you for reaching out to us.
>
> With regards to encountered error PERMISSION_DENIED
> <https://developers.google.com/google-ads/api/docs/best-practices/common-errors?hl=en#user_permission_denied>,
> note that you may receive the error ‘USER_PERMISSION_DENIED’ when a user
> doesn't have permission to access a customer and you’re accessing a client
> customer using 'login-customer-id’ in the request.
>
> That being said, you will need to ensure that the user / email address you
> used to generate the credentials indeed has access
> <https://support.google.com/google-ads/answer/9978556?visit_id=637628826037447236-382779227&rd=1>
> to the account in your request. If the user / email address has access or
> is associated with the MCC / manager account, you will need to specify the
> MCC / manager account's ID without hyphens (-) as the value of the
> login-customer-id
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid>
> field.
>
> However, for our team to validate this, could you please provide us the
> complete API logs (request
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
> and response
> <https://https//developers.google.com/google-ads/api/docs/concepts/field-service#response>
> logs with request ID
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id>)
> generated on your end? Note that this can be requested or provided to the
> developer handling the Google Ads API transactions when logging of the API
> requests has been enabled.
>
> These are the specific guidelines to enable it.
>
>    - Java -
>    https://developers.google.com/google-ads/api/docs/client-libs/java/logging
>    - .Net -
>    
> https://developers.google.com/google-ads/api/docs/client-libs/dotnet/logging
>    - PHP -
>    https://developers.google.com/google-ads/api/docs/client-libs/php/logging
>    - Python -
>    
> https://developers.google.com/google-ads/api/docs/client-libs/python/logging
>    - Ruby -
>    https://developers.google.com/google-ads/api/docs/client-libs/ruby/logging
>    - Perl -
>    https://developers.google.com/google-ads/api/docs/client-libs/perl/logging
>
> You may then send the requested information via the Reply privately to
> author option. If this option is not available, you may send the details
> directly to our googleadsapi-supp...@google.com alias instead.
>
> Best regards,
> [image: Google Logo]
> Heidi
> Google Ads API Team
>
>
> ref:_00D1U1174p._5004Q2egw0m:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/CAHZxGG1ixVOoPsXBhZ8T%3DVoL9rYvzdDzPL3TTdoLzEE%2BqF2j3Q%40mail.gmail.com.
  • (S... CK
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Ng Cheng Kiang

Reply via email to