14
votes

We have an application that does migrations between Google Apps domains. For calendar migrations we using Import API(https://developers.google.com/google-apps/calendar/v3/reference/events/import). For last six months we did a lot of calendar migrations. But about week ago we faced with new API error for import:

    "error"=>
  {"errors"=>[
    {"domain"=>"usageLimits",
    "reason"=>"quotaExceeded",
    "message"=>"Calendar usage limits exceeded."}], 
  "code"=>403, 
  "message"=>"Calendar usage limits exceeded."

Last week we got a lot of "Calendar usage limits exceeded." errors for users from different domains. Accordingly to Google API Console we didn't reach daily quota limit. For our app we using 2legged authorization.

Please help us understand what does "Calendar usage limits exceeded." mean? How we can prevent this error? Where we can find information about Calendar usage limits?

7

7 Answers

7
votes

Having the same issue.

I am using Version 3 code, TwoLeggedOAuthCredentials and the program is an authorized registered client (IOW: the calendars are created on behalf of multiple accounts.)

Last successful large imports: 2013-01-21, 4929 Google requests & 2013-01-22, 1103 Google requests (spread across multiple users)

At about 4% of our quota (https://code.google.com/apis/console/b/0/#project:1077083635926:quotas) the program starts getting the following error: https://www.googleapis.com/calendar/v3/calendars?alt=json returned "Calendar usage limits exceeded.">

If the program is re-run after a time (15 minutes +) it will run a couple more requests before receiving the same error. The calendar information it errored on previously will succeed if re-run after a "cool-off" period. The code itself sleeps for the number of times it receives that error multiplied by 20 seconds and tries ten times (waits 20 seconds after the first error, forty seconds after the second error) but it has increased the time to run the program greatly.

I increased the per user limit from 5 requests/second/user to 10.0 requests/second/user yesterday. So far this has had no noticeable change in behavior. Stepping through the code slowly also doesn't seem to have impact, leading me to believe it is unrelated to the requests per second.

If this is an undocumented per-user quota (and not their well documented request/second/user quota) it is new.

7
votes

I found this official support document, and here's some brief info below, hope it helps: https://support.google.com/a/answer/2905486?hl=en

Calendar usage limits exceeded. This is the result of an API call. (Don't mix this up with the message "Daily quota exceeded," which points to insufficient API quota.)

If a user sees one of these messages it’s probably due to one of the following reasons:

  • Creating too many events

If a user has created more than 10,000 events in his or her calendar within a short period of time, that user might lose calendar edit access.

  • Creating too many calendars

If a user creates more than 25 new calendars within a short period of time, that user's calendar might go into read-only mode.

  • Sending too many invitations or emails to external guests

In order to prevent spamming, Google Calendar limits the number of invitations a user can send to external guests. This limit varies depending on the action, and is usually between 100-300 guests.

Google Apps users can send invitations to any number of guests from their primary domain, or from secondary domains associated with their primary domain.

  • Sharing calendars with too many users

If a user shares one or more calendars with many other users within a short period of time, Google Calendar might switch into read-only mode for that user. It’s almost impossible to reach this limit by updating sharing settings manually, but it can happen with some API-based tools or third-party apps.

6
votes

After analysing logs, I found

Free Google Apps Account For a user: Initially: 100 Extenal Guests Domains Emails limit Accumulative: 1 External Guest for 40 Minutes

Ex: If you have a fresh token you can send any one *. 50 Events having 100 guest - 2 Guests per event *. 25 Events having 100 guest - 4 Guests per event

Limits per

Day: 36 Guests

Week: 252 Guests

Month: ~1080 Guests

Where Purchased GSuite Calendar API gives initial limit of 1000 Guest Request

https://github.com/manjeshpv/gsuite-google-calendar-api-limits

You’ll get 1000(guest emails outside your domain) day you login + 1 guest email invite for every 40 minutes. When you exceed this limitation you get this error

Using Google Calendar ****Google Calendar (https://calendar.google.com)

Unable to save event You have reached the limit for the number of events you can edit. Please wait a few hours for your account to be reviewed. We appreciate your patience. Note: This may be the result of a third party application you may have installed that interacts with Google Calendar, such as a syncing application.

Using API Based approach

Error: Calendar usage limits exceeded. code: 403, errors: [ { domain: 'usageLimits', reason: 'quotaExceeded', message: 'Calendar usage limits exceeded.' } ] }

1
votes

In addition to app quotas, there are some per-user limits that are independent of the app. If somebody is a heavy user of calendar or if you're doing a lot of activity for a small set of users, the app can be limited even if your app is under its total API quota.

0
votes

I have the same issue and found that there is a quota on how many external guests (guests that live on another domain) that you can invite. This quota is documented here:

http://support.google.com/a/bin/answer.py?hl=en&answer=2905486

I don't know of any solution currently, but if you find one, I would find it helpful also. Best of luck.

0
votes

I was having this problem while inserting a lot of events with invited people outside my Google Apps domain. I got following reply from Google Apps Support:

"There is limit that Calendar enforced on how many events you can invite from one calendar. The limit get reached very quickly if the invite go to a user that's not in Google Apps."

Hope it helps.

0
votes

The limit on external attendees seems to be very strict, and accumulates aggressively.

For testing on G Suite, it's better to only synchronise attendees from the primary domain.