title: Google Calendar API returns a rate limit exceeded error during batch processing
body: <p>Following my previous <a href="https://stackoverflow.com/questions/60988677">question</a> ... I changed the Google Calendar API call to <a href="https://developers.google.com/calendar/batch" rel="nofollow noreferrer">batch</a>, but some requests in the batch return a 403 - <a href="https://stackoverflow.com/questions/48868737/">rateLimitExceeded</a> "Rate Limit Exceeded" error. There is always a maximum of 50 requests of the same type in the batch, most often PATCH. But errors occur even if the batch contains less than 10 requests. On average, only about 50% of all requests are successful.</p>
  
  <p>Example request (part with one reguest):</p>
  
  <pre><code>--googlebatch_20200513_171515_647
  Content-Type: application/http
  Content-ID: &lt;item:0&gt;
  
  PATCH /calendar/v3/calendars/XXX/YYY
  Content-Type: application/json
  Content-Length: 449
  
  {
    "summary": "Opakovaná aktivita 2",
    "description": "",
    "id": "XXX",
    "start": { "dateTime": "2020-05-07T09:00:00+02:00" },
    "end": { "dateTime": "2020-05-07T09:30:00+02:00" },
    "location": "", 
    "visibility": "default", 
    "reminders": {"useDefault": false},
    "transparency": "opaque", 
    "extendedProperties": {
      "private": {
        "X-QIID": "29037717,10",
        "X-QISyncOn": "1"
      }
    }
  }
  ...
  next requests
  ... 
  --googlebatch_20200513_171515_647--
  </code></pre>
  
  <p>Example response:</p>
  
  <pre><code>--batch_preSx1sqdvk_AAP51GVWcoo
  Content-Type: application/http
  Content-ID: &lt;response-item:0&gt;
  
  HTTP/1.1 403 Forbidden
  Content-Type: application/json; charset=UTF-8
  Date: Mon, 13 May 2020 15:15:16 GMT
  Expires: Mon, 13 May 2020 15:15:16 GMT
  Cache-Control: private, max-age=0
  Content-Length: 199
  
  {
   "error": {
    "errors": [
     {
      "domain": "usageLimits",
      "reason": "rateLimitExceeded",
      "message": "Rate Limit Exceeded"
     }
    ],
    "code": 403,
    "message": "Rate Limit Exceeded"
   }
  }
  --batch_preSx1sqdvk_AAP51GVWcoo--
  </code></pre>
  
  <p>I don't understand why the Google API returns this error, because when I send a batch request, I just send the batch and the execution of individual requests is controlled by Google itself. So I have no way to influence the speed of their launch. If batch execution is too fast, why doesn't Google slow it down and complete all requests successfully?</p>
  
  <p>What else could I do? Where could be the mistake? What do you recommend me?</p>
  
  <p>Thank you. Regards, Petr.</p>