Hi Xiaoming,

Thanks a lot for the quick reply.

I added the logger as mentioned, but it logs only the requests and not the SOAP 
response of the error (Please find the details below).

Here’s the snippet of the code:

```
API_VERSION = :v201809
api = AdwordsApi::Api.new(config)
report_utils = api.report_utils(API_VERSION)

report_definition = {
    selector: {
        fields: %w(CampaignId Impressions Clicks Cost),
        # Predicates are optional.
        predicates: {
            field: 'CampaignId',
            operator: 'IN',
            values: campaigns.collect { |c| c[:id] }
        },
        date_range: {min: start_date, max: start_date}
    },
    report_name: '-',
    report_type: 'CAMPAIGN_PERFORMANCE_REPORT',
    download_format: 'XML',
    date_range_type: 'CUSTOM_DATE'
}

target_xml = report_utils.download_report(report_definition)

```

Log from console:

```
.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/google-adwords-api-1.5.0/lib/adwords_api/report_utils.rb:300:in
 `check_for_xml_error': HTTP code: 400, error type: 
'RateExceededError.RATE_EXCEEDED', trigger: 'Basic Access Daily Reporting 
Quota', field path: '' (AdwordsApi::Errors::ReportXmlError)
        from 
.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/google-adwords-api-1.5.0/lib/adwords_api/report_utils.rb:284:in
 `check_for_errors’
```

Logs from logger file:

```
D, [2019-11-19T12:15:49.259816 #90398] DEBUG -- : Report request to: 
'https://adwords.google.com/api/adwords/reportdownload/v201809'
D, [2019-11-19T12:15:49.259882 #90398] DEBUG -- : HTTP headers: [Content-Type: 
application/x-www-form-urlencoded, Authorization: Bearer <token>, User-Agent: 
<agent> (AwApi-Ruby/1.5.0, Common-Ruby/1.0.2, GoogleAdsSavon/1.0.3, ruby/2.4.4, 
HTTPI/2.4.4, httpclient), clientCustomerId: <client id>, developerToken: 
<token>]

D, [2019-11-19T12:15:49.259915 #90398] DEBUG -- : 
__rdxml=%3CreportDefinition%3E%3Cselector%3E%3Cfields%3ECampaignId%3C%2Ffields%3E%3Cfields%3EImpressions%3C%2Ffields%3E%3Cfields%3EClicks%3C%2Ffields%3E%3Cfields%3ECost%3C%2Ffields%3E%3Cpredicates%3E%3Cfield%3ECampaignId%3C%2Ffield%3E%3Coperator%3EIN%3C%2Foperator%3E%3Cvalues%3E<value>%3C%2Fpredicates%3E%3CdateRange%3E%3Cmin%3E20191118%3C%2Fmin%3E%3Cmax%3E20191118%3C%2Fmax%3E%3C%2FdateRange%3E%3C%2Fselector%3E%3CreportName%3E-%3C%2FreportName%3E%3CreportType%3ECAMPAIGN_PERFORMANCE_REPORT%3C%2FreportType%3E%3CdateRangeType%3ECUSTOM_DATE%3C%2FdateRangeType%3E%3CdownloadFormat%3EXML%3C%2FdownloadFormat%3E%3C%2FreportDefinition%3E
D, [2019-11-19T12:15:49.260264 #90398] DEBUG -- : HTTPI /peer POST request to 
adwords.google.com (httpclient)
D, [2019-11-19T12:15:50.833572 #90398] DEBUG -- : HTTP headers: [Content-Type: 
text/xml, Content-Encoding: gzip, Date: Tue, 19 Nov 2019 06:45:50 GMT, Expires: 
Tue, 19 Nov 2019 06:45:50 GMT, Cache-Control: private, max-age=0, 
X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-XSS-Protection: 
1; mode=block, Server: GSE, Alt-Svc: quic=":443"; ma=2592000; 
v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; 
ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, 
Transfer-Encoding: chunked]
```

Can you guide me in what could be the possible reason for rate limit error and 
how to fix it?
The code has not changed in last 5 months, but this RateLimitIssue started 
coming only from 14th November 2019.

-
Thank you,
Murtaza Basrai


> On 19-Nov-2019, at 1:11 AM, Google Ads API Forum Advisor Prod 
> <[email protected]> wrote:
> 
> Hi Murtaza,
> 
> Thanks for reaching out. Please follow this guide 
> <https://github.com/googleads/google-api-ads-ruby/blob/master/adwords_api/README.md#23---logging>
>  on how to enable the logging in the Ruby client library to get the complete 
> logs of the SOAP request and response. Please let us know if you still have 
> questions after trying this.
> 
> Thanks and regards,
> Xiaoming, Google Ads API Team
> 
> 
> 
> ref:_00D1U1174p._5001UOCPTv: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/F2EE9089-A04F-41BD-9B00-E945DB1D400D%40gmail.com.

Reply via email to