Dwyanie smith
Dwyanie smith

Reputation: 31

Google Calendar API error : usage limits exceeded

I'm working with google calendar API.

I'm getting error message :

Calendar usage limits exceeded

Error in details :

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

This happens anytime sometimes in just inserting 5 events or sometimes more than 25 and even I have used batch request for inserting events. Is there any way that is specially available for testing calendar API?

Upvotes: 2

Views: 1718

Answers (2)

jpa57
jpa57

Reputation: 587

The original question asks "Is there any way that is specially available for testing calendar API?". This is really the core issue. There is a lack of transparency as to what causes this error to occur. I have read https://support.google.com/a/answer/2905486?hl=en, but none of those apply to my application. If I knew what is really causing this error, I might be able to avoid it.

I previously had a Google Calendar simulator for a lot of my testing but it became too arduous and was bypassing testing, so recently converted to using test accounts made of free gmail accounts to target insertions of test data and then read it out. I don't have to try very hard or do a lot of inserts to cause this error. I have implemented exponential backoff starting at 6 seconds; it allowed an insert at 25 minutes after initial failure. That was for a failure which occurred inserting a single event about two minutes later than the previous insert to the same account. The failing insert was the 9th insert of the same data into the same calendar over a period of almost 20 minutes, the 10th in 30 minutes. These are not large numbers in a test environment.

This is a serious impediment to testing. The only way I can see to work around this is to acquire a pool of gmail accounts and pull a new one from the pool when I wear one out. Not only is that more work and maintenance for me, it's bad for google too because of a bunch of accounts that don't map to real users.

If someone has a better idea I'm all ears. What I'd prefer is a way of opting in to testing on specific google accounts, meaning the user expressly asks for google to not be concerned with abuse (assuming that's the rationale for this error).

Upvotes: 2

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17613

I think you're making too many API calls at the same time. Give it a time interval or use Batching of Requests. Also use Exponential Backoff to handle 4xx error retries.

Additional note:

The following may be causing your problem according to Calendar usage limits:

Resolution

If users hit the Google Calendar limits, they should be able to edit their calendars normally again within several hours. Users will still be able to view events in Calendar during that period.

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

1. 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.

2. 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.

3. 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.

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

4. 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.

Upvotes: 0

Related Questions