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.Id
<http://googleadsrow.campaign.id/>, googleAdsRow.Campaign.Name
<http://googleadsrow.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.Id
<http://googleadsrow.campaign.id/>, googleAdsRow.Campaign.Name
<http://googleadsrow.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
--
*“CONFIDENTIALITY
/ DISCLAIMER NOTICE*: The information in this e-mail
and any attachments
is confidential and may be legally privileged. It is
intended solely for the
addressee. If you are not the intended recipient
and have received this
communication in error, please notify the sender
immediately by return e-mail,
delete this e-mail and destroy any copies of
it. Any unauthorized copying,
disclosure or distribution of the material in
this e-mail is strictly
forbidden. Reasonable
precautions have been taken
to ensure that this e-mail is virus-free. However,
Logicserve does not
accept responsibility for any loss
or damage arising from the use of this
e-mail or any attachments.”
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
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/CAFwwCxBAE0v_arPcuromyfB%3Dn6_nEoG7rJwsXJTEq2_teHc9dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.