2
votes

I'm trying to test adding an event to my Google Calendar using Google API Explorer page at Google API Explorer - calendar.event.insert

Specifying 'primary' as the calendarId, and enabling 'OAuth 2.0' authorization.

The request body field is as follows:

{
  "summary": "Another test",
  "start": {
    "dateTime": "2017-01-17T11:30:00+02:00"
  },
  "end": {
    "dateTime": "2017-01-17T12:00:00+02:00"
  },
  "attendees": [
    {
      "email": "some_mail@some_domain.com"
    }
  ]
}

But when clicking the 'Authorize and Execute' button, I get the following error:

403

- Show headers -

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

If I send the same request but without the 'attendees' part, it works every time.

What am I doing wrong here?

1
I have found this article, that might put some light on this bug: code.google.com/a/google.com/p/apps-api-issues/issues/…Nir Kornfeld
Not related that's using service accounts your not using service accounts.DaImTo
here is my solution step by step: stackoverflow.com/a/63715242/5212039Anathorn

1 Answers

1
votes

API explorer dumps you into the same quota with everyone else using the api explorer as most of the quotas are project based and its the same project.

You are probably getting it because there are other people testing what you are testing at the same time. There are also limits to what you can test with that. I suspect it wasn't meant to be fully functional.

Also check Calendar usage limits How much have you been testing?

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

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.

Solution: Send the requests from your own application rather then using api explorer.

What I am sending works fine.

POST https://www.googleapis.com/calendar/v3/calendars/primary/events?sendNotifications=true&key={YOUR_API_KEY}

{
 "end": {
  "dateTime": "2017-01-17T11:30:00+02:00"
 },
 "start": {
  "dateTime": "2017-01-17T11:30:00+02:00"
 },
 "attendees": [
  {
   "email": "[email protected]"
  }
 ]
}

Response:

200

- Show headers -

{


 "kind": "calendar#event",
 "etag": "\"2969293763864000\"",
 "id": "did1s0f76g79s1ht5aplhieoik",
 "status": "confirmed",
 "htmlLink": "https://www.google.com/calendar/event?eid=ZGlkMXMwZjc2Zzc5czFodDVhcGxoaWVvaWsgbGF1cmx5NzFAbQa",
 "created": "2017-01-17T09:54:41.000Z",
 "updated": "2017-01-17T09:54:41.932Z",
 "creator": {
  "email": "[email protected]",
  "displayName": "Linda Lawton",
  "self": true
 },
 "organizer": {
  "email": "[email protected]",
  "displayName": "Linda Lawton",
  "self": true
 },
 "start": {
  "dateTime": "2017-01-17T10:30:00+01:00"
 },
 "end": {
  "dateTime": "2017-01-17T10:30:00+01:00"
 },
 "iCalUID": "[email protected]",
 "sequence": 0,
 "attendees": [
  {
   "email": "ll@xxxxx",
   "responseStatus": "needsAction"
  }
 ],
 "reminders": {
  "useDefault": true
 }
}