Name resolution failure Google Ads Api

59 views
Skip to first unread message

facebook....@gmail.com

unread,
Mar 28, 2019, 11:09:00 AM3/28/19
to AdWords API and Google Ads API Forum
Hi Team,

I am consuming the new Google Ads Api using the .NET client library. I have generated all configuration file using the ClientId and client_secretID and have also enabled Google Ads APi in my console api library. However, I am getting the following error messages.

"Status(StatusCode=Unavailable, Detail="Name resolution failure")"

Please find the code snippet below.


            // Get the GoogleAdsService.
            GoogleAdsServiceClient googleAdsService = client.GetService(
                Services.V0.GoogleAdsService);

            // Create a request that will retrieve all campaigns using pages of the specified
            // page size.
            SearchGoogleAdsRequest request = new SearchGoogleAdsRequest()
            {
                PageSize = PAGE_SIZE,
                Query = @"SELECT
                            campaign.id,
                            campaign.name,
                            campaign.network_settings.target_content_network
                        FROM campaign
                        Where segments.date DURING LAST_30_DAYS
                        ORDER BY campaign.id",
                CustomerId = customerId.ToString()
            };
            //Where segments.date DURING LAST_30_DAYS

            try
            {
                // Issue the search request.
                PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow> searchPagedResponse =
                    googleAdsService.Search(request);

                foreach (SearchGoogleAdsResponse response in searchPagedResponse.AsRawResponses())
                {
                    Console.WriteLine(response.FieldMask.Paths);
                    foreach (GoogleAdsRow googleAdsRow in response.Results)
                    {
                        Console.WriteLine("Campaign with ID {0} and name '{1}' was found.",
                            googleAdsRow.Campaign.IdgoogleAdsRow.Campaign.Name);
                    }
                }
                // Iterate over all rows in all pages and prints the requested field values for the
                // campaign in each row.
                foreach (GoogleAdsRow googleAdsRow in searchPagedResponse)
                {
                    Console.WriteLine("Campaign with ID {0} and name '{1}' was found.",
                        googleAdsRow.Campaign.IdgoogleAdsRow.Campaign.Name);
                }
            }
            catch (GoogleAdsException e)
            {
                Console.WriteLine("Failure:");
                Console.WriteLine($"Message: {e.Message}");
                Console.WriteLine($"Failure: {e.Failure}");
                Console.WriteLine($"Request ID: {e.RequestId}");
            }
        
Kindly assist me with this.

Thanks and Regards,
Swapnil Gaikwad

Klaus Jensen

unread,
Mar 29, 2019, 5:21:22 PM3/29/19
to AdWords API and Google Ads API Forum
I have the exact same problem, also using .net library.

googleadsapi...@google.com

unread,
Mar 31, 2019, 9:08:21 PM3/31/19
to AdWords API and Google Ads API Forum
Hi Swapnil,

I can see that you have already posted your concern on this GitHub Issue Tracker. You could continue your communication there as the client library owners will be able to better assist you in your concern.

@Klaus, you could also refer to the same post if you think you are encountering the same issues. If not, kindly open a new thread with a clear explanation of your issue for better communication.

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 03/29/19 22:20:26 kl...@sixfootfour.net wrote:
I have the exact same problem, also using .net library.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1cac721a-65b6-4662-8992-40cdad330ef8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages