Hello.
I tried another example and again an internal error. (Message: 
Status(StatusCode=Internal, Detail="Internal error encountered."))


using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V2.Errors;
using Google.Ads.GoogleAds.V2.Services;
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.Util;
using Google.Api.Gax;
using System;

namespace Google.Ads.GoogleAds.Examples.V2
{
    public class GetKeywordStats : ExampleBase
    {
        public static void Main(string[] args)
        {
            GetKeywordStats codeExample = new GetKeywordStats();
            Console.WriteLine(codeExample.Description);
            
TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE, 
"C:\\logs\\details.log", System.Diagnostics.SourceLevels.All);
            long customerId = long.Parse("1987233529");

            GoogleAdsConfig config = new GoogleAdsConfig()
            {
                LoginCustomerId = "XXX",
                DeveloperToken = "XXX",
                OAuth2ClientId = "XXX.apps.googleusercontent.com",
                OAuth2ClientSecret = "XXX",
                OAuth2RefreshToken = "XXX"
            };

            GoogleAdsClient client = new GoogleAdsClient(config);

            codeExample.Run(client, customerId);
            Console.Read();
        }

        public override string Description
        {
            get
            {
                return "This code example illustrates getting keyword 
stats.";
            }
        }

        public void Run(GoogleAdsClient client, long customerId)
        {
            GoogleAdsServiceClient googleAdsService = client.GetService(
                Services.V2.GoogleAdsService);

            string query =
                $@"SELECT
                 campaign.id,
                 campaign.name,
                 ad_group.id,
                 ad_group.name,
                 ad_group_criterion.criterion_id,
                 ad_group_criterion.keyword.text,
                 ad_group_criterion.keyword.match_type,
                 metrics.impressions,
                 metrics.clicks,
                 metrics.cost_micros,
                 metrics.video_quartile_25_rate
             FROM keyword_view
             WHERE segments.date DURING LAST_7_DAYS
                 AND campaign.advertising_channel_type = 'SEARCH'
                 AND ad_group.status = 'ENABLED'
                 AND ad_group_criterion.status IN ('ENABLED','PAUSED')
             ORDER BY metrics.impressions DESC
             LIMIT 50";
            try
            {
                // Issue a search request.
                PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow> 
result =
                    googleAdsService.Search(customerId.ToString(), query);

                // Display the results.
                foreach (GoogleAdsRow criterionRow in result)
                {
                    Console.WriteLine(
                        $"Keyword with text 
'{criterionRow.AdGroupCriterion.Keyword.Text}', " +
                        $" match type 
'{criterionRow.AdGroupCriterion.Keyword.MatchType}' and " +
                        $"ID {criterionRow.AdGroupCriterion.CriterionId} " +
                        $"in ad group '{criterionRow.AdGroup.Name}' with " +
                        $"ID {criterionRow.AdGroup.Id} " +
                        $"in campaign '{criterionRow.Campaign.Name}' " +
                        $"with ID {criterionRow.Campaign.Id} " +
                        $"had {criterionRow.Metrics.Impressions.ToString()} 
impressions, " +
                        $"{criterionRow.Metrics.Clicks} clicks, and " +
                        $"{criterionRow.Metrics.CostMicros} cost (in 
micros)" +
                        "during the last 7 days.");
                }
            }
            catch (GoogleAdsException e)
            {
                Console.WriteLine("Failure:");
                Console.WriteLine($"Message: {e.Message}");
                Console.WriteLine($"Failure: {e.Failure}");
                Console.WriteLine($"Request ID: {e.RequestId}");
            }
        }
    }
}




вторник, 22 октября 2019 г., 21:22:11 UTC+3 пользователь adsapiforumadvisor 
написал:
>
> Hello,
>
> Thank you for reaching out. This 'Internal error encountered' could be a 
> transient error. Could you please retry the request after a short pause to 
> check if the issue persists? If yes, could you please provide the complete 
> request and error response logs along with the client customer id by 
> enabling logging using this guide 
> <https://github.com/googleads/google-ads-dotnet/> for me to investigate 
> better? Please use *Reply privately to author* option while sharing the 
> details.
>
> Regards,
> Nikisha Patel, Google Ads API Team
>
>
> ref:_00D1U1174p._5001UKO4sI: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 [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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ebd9991c-33cd-450f-bc1f-d3a829c20705%40googlegroups.com.
GoogleAds.DetailedRequestLogs Information: 1 : [2019-10-29 10:31:27Z] - 
---------------BEGIN API CALL---------------

Request
-------

Method Name: /google.ads.googleads.v2.services.GoogleAdsService/Search
Host: https://googleads.googleapis.com
Headers: {
  "x-goog-api-client": "gl-dotnet/4.5.2 gccl/2.5.0 gapic/2.5.0 gax/2.9.0 
grpc/1.22.1",
  "developer-token": "REDACTED",
  "login-customer-id": "198-723-3529",
  "x-goog-request-params": "customer_id=1987233529"
}

{ "customerId": "1987233529", "query": "SELECT\r\n                 
campaign.id,\r\n                 campaign.name,\r\n                 
ad_group.id,\r\n                 ad_group.name,\r\n                 
ad_group_criterion.criterion_id,\r\n                 
ad_group_criterion.keyword.text,\r\n                 
ad_group_criterion.keyword.match_type,\r\n                 
metrics.impressions,\r\n                 metrics.clicks,\r\n                 
metrics.cost_micros,\r\n                 metrics.video_quartile_25_rate\r\n     
        FROM keyword_view\r\n             WHERE segments.date DURING 
LAST_7_DAYS\r\n                 AND campaign.advertising_channel_type = 
'SEARCH'\r\n                 AND ad_group.status = 'ENABLED'\r\n                
 AND ad_group_criterion.status IN ('ENABLED','PAUSED')\r\n             ORDER BY 
metrics.impressions DESC\r\n             LIMIT 50" }

Response
--------
Headers: {
  "date": "Tue, 29 Oct 2019 10:31:24 GMT",
  "alt-svc": "quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q048=\":443\"; 
ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000"
}

Fault: Grpc.Core.RpcException: Status(StatusCode=Internal, Detail="Internal 
error encountered.")
----------------END API CALL----------------

Reply via email to