0

I work for an Student Information System and we're using the Admin SDK directory API to create school districts Google Org Unit structures from within our software.

POST https://www.googleapis.com/admin/directory/v1/customer/customerId/orgunits

When generating these API requests we're consistently receiving dailyLimitExceeded errors even when the district's quota has not been reached.

This error can be bypassed by ignoring the error, and implementing an exponential back-off routine, but I believe this to be acting much more like the quotaExceeded error is intended to act rather than dailyLimitExceeded, in that the request succeeds afterward on the first retry of this request.

In detail, the test I just ran successfully completed 9 of these API calls and then I received this response on the 10th:

Google.Apis.Requests.RequestError Quota limit exceeded for the day. [403] Errors [Message[Quota limit exceeded for the day.] Location[ - ] Reason[dailyLimitExceeded] Domain[usageLimits]

From the start of the batch of API calls it took about 10 seconds to get to the point where the error occurred.

Thanks for your help!

1 Answers1

0

What I would suggest is to slow down your API requests. Don't make like 10 requests in 1 second. Give it a space in between requests. You are correct to implement exponential backoff. Also, if you can, use other accounts as well to make requests.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • Sorry if it wasn't stated clearly, it failed on the 10th request, and took 10 seconds to reach that point. So it's actually averaging around 1 request per second. In this case I don't believe the use of additional accounts would be appropriate since it's a one time setup procedure for the domain's organizational units. Everything ends up actually working as intended as long as I allow dailyLimitExceeded as a retry-able error code in the exponential back-off. My issue is that dailyLimitExceeded isn't a retry-able error. – Matt Hoffman Sep 29 '17 at 17:13