Hi, I've enabled the Ads API in the cloud console, created a OAuth Consent Screen, created credentials for my Web application and saved the Google Ads API OAuth ClientId and Secret for my Projekt.
When a user is logging in with his Google account into my Application, the application is asking for access to the users Ads data and I'm storing the users refresh token. Now I'm trying to list accessible customers from this code example <https://developers.google.com/google-ads/api/samples/list-accessible-customers>, using my ClientId, Client Secret + the User RefreshToken. private GoogleAdsConfig googleAdsConfig { get { return new GoogleAdsConfig() { DeveloperToken = "", OAuth2Mode = OAuth2Flow.APPLICATION, OAuth2ClientId = Configuration["GoogleAdsAPIOAuthClientId"], OAuth2ClientSecret = Configuration["GoogleAdsAPIOAuthClientSecret"], OAuth2RefreshToken = UserRefreshToken, LoginCustomerId = "", }; } } public GoogleAdsClient getClient() { return new GoogleAdsClient(googleAdsConfig); } public List<string> GetGoogleAdsLinkedAccounts() { GoogleAdsClient client = getClient(); // Get the CustomerService. CustomerServiceClient customerService = client.GetService(Services.V15.CustomerService); var customerList = new List<string>(); // Retrieve the list of customer resources. string[] customerResourceNames = customerService.ListAccessibleCustomers(); // Display the result. foreach (string customerResourceName in customerResourceNames) { customerList.Add(customerResourceName); } return customerList; } When running this I'm receiving below error, could you advise what I'm doing wrong? 'One or more errors occurred. (Status(StatusCode="Internal", Detail="Error starting gRPC call. TokenResponseException: Error:"unauthorized_client", Description:"Unauthorized", Uri:""", DebugException="Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"unauthorized_client", Description:"Unauthorized", Uri:"" -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/a89d1179-a80e-45ee-8e5c-358a1296c1cen%40googlegroups.com.
