4
votes

The google calendar API and the google drive API allows batch requests.

To do so, you need execute a POST on www.googleapis.com/batch And the body of the request contain the list of GET/POST/DELETE of your differents requests.

According to https://developers.google.com/google-apps/calendar/batch and https://developers.google.com/drive/web/batch

You can even group requests for multiple users or multiple Google APIs.

Does it mean I can send a request for the calendar API and a request for the drive API in the SAME batch ?

If so, https://developers.google.com/google-apps/calendar/batch says :

You're limited to 50 calls in a single batch request. If you need to make more calls than that, use multiple batch requests.

And https://developers.google.com/drive/web/batch says :

You're limited to 1000 calls in a single batch request. If you need to make more calls than that, use multiple batch requests.

Which value is the correct one ?


More about others APIs :

For https://developers.google.com/webmaster-tools/v3/how-tos/batch They forgot to give the host name ( www.googleapis.com ? ). In the example they just put :

Host: host They say the limit is 1000 but didn't say if you can call others APIs in the same batch

For https://developers.google.com/admin-sdk/reseller/v1/how-tos/batch They show in the example :

POST https://www.googleapis.com/batch

They say the limit is 1000 and specify :

You can even group requests for multiple users or multiple Google APIs.

1
You cannot combine different API calls in a single batch request. Multiple google API's means I think, multiple requests to same API. It could be for single user or multiple users. Drive API limit to single batch is 1000 calls but calendar is just 50 requests. You can check the example provided in the documentation where host name is given as Host: www.googleapis.com, POST /drive/v2/files/fileId/permissions - SGC

1 Answers

3
votes

After experiments, It is not possible to mix differents API (calendar, drive, ...) in the same batch. So each API has its own limit.

And, for google calendar, there is another limitation :

Cannot perform operations on different calendars in the same batch request.

(error "400 Bad Request", reason "cannotOperateOnDifferentCalendarsInBatch")