Hi,
I implemented the required logs in my application. However, the error 
raises when I try to generate the GoogleAdsClient and therefore no request 
is send and no logs are generated.

Here is the structure of the dict (JSON) I send to the "load_from_dict" 
function to generate the client
{
    "developer_token": "<DEVELOPER_TOKEN>",
    "use_proto_plus": "True",
    "login_customer_id": "<LOGIN_CUSTOMER_ID>",
    "json_key_file_path":"service_account_json_key.json",
    "impersonated_email":"<IMPERSONATED_EMAIL>"
}

According to the documentation here 
(https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-service),
 
I don't use credentials like "client_id", "client_secret" or 
"refresh_token" to trigger the other flows.

I sent you privately the structure with the real values and the code I use 
to generate the client.

Hope you can help me to find if there is a field I'm missing or adding 
unintentionally in order to not trigger the Service Account Flow

Anthony

On Monday, March 7, 2022 at 2:00:00 AM UTC-5 adsapi wrote:

> Hi Anthony,
>
> Thank you for the reply. I am also a member of the Google Ads API team and 
> let me provide support to your concern.
>
> Upon checking the error message, I can see that the authentication flow 
> that the API is validating is still *OAuth2 desktop app or web app flow* even 
> though you are implementing a service account. With this, you may try 
> following this guide 
> <https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-service>
>  as 
> it discusses the steps on how to implement the service account for Python 
> client library. 
>
> However, we strongly recommend using OAuth2 desktop app or web app flow 
> <https://developers.google.com/google-ads/api/docs/oauth/cloud-project#choose_an_application_type>
>  
> instead of service accounts (for example, impersonation). OAuth2 desktop 
> app and web app flows do require an initial user interaction for granting 
> access to the account, but are much simpler to set up. For the OAuth2 
> desktop app flow 
> <https://developers.google.com/google-ads/api/docs/oauth/cloud-project#desktop>,
>  
> you can persist a refresh token (which never expires) to obtain a new 
> access token whenever necessary. When using one of our client libraries 
> <https://developers.google.com/google-ads/api/docs/oauth/client-library>, 
> you can authorize your app by filling out a configuration file.
>
> However, if you still prefer a service account and the issue persists 
> after trying the provided suggestion, then please provide the complete 
> request 
> <https://developers.google.com/google-ads/api/docs/concepts/field-service#request>
>  and response 
> <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>
>  and request header 
> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>
>  generated 
> on your end. You can check the provided links to have a clearer view on the 
> information that I am asking. This information can be extracted when 
> logging of the API transaction is enabled. If not enabled, then you can 
> follow one of the guides below for the specific client library that you are 
> us:
> 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
>
> Please provide it in the private email thread.
>
> Regards,
> [image: Google Logo] 
> Ernie John 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2Xk3z4: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/0474b5aa-7f8d-44d0-b736-d62fd7687e32n%40googlegroups.com.
  • RE... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
    • ... Anthony Gomez Taboada
      • ... Anthony Gomez Taboada
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... Anthony Gomez Taboada

Reply via email to