Strange error 403: “Calendar usage limits exceeded” when adding event with attendee

不问归期 提交于 2019-12-06 09:53:28

问题


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:


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": "ll@xxxx.com"
  }
 ]
}

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": "xxxx@gmail.com",
  "displayName": "Linda Lawton",
  "self": true
 },
 "organizer": {
  "email": "xxxxx@gmail.com",
  "displayName": "Linda Lawton",
  "self": true
 },
 "start": {
  "dateTime": "2017-01-17T10:30:00+01:00"
 },
 "end": {
  "dateTime": "2017-01-17T10:30:00+01:00"
 },
 "iCalUID": "1s0f76g79s1ht5aplhieoik@google.com",
 "sequence": 0,
 "attendees": [
  {
   "email": "ll@xxxxx",
   "responseStatus": "needsAction"
  }
 ],
 "reminders": {
  "useDefault": true
 }
}


来源:https://stackoverflow.com/questions/41693043/strange-error-403-calendar-usage-limits-exceeded-when-adding-event-with-atten

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!