Google API 和批量请求不同的 API 和限制

Google API and batch requests for different APIs and limites

google 日历 API 和 google 驱动器 API 允许批量请求。

为此,您需要在 www.googleapis 上执行 POST。com/batch 并且请求的正文包含 GET/POST/DELETE 您的不同请求的列表。

根据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.

这是否意味着我可以在同一批次中发送日历请求 API 和驱动器 API 请求?

如果是这样,https://developers.google.com/google-apps/calendar/batch 表示:

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

并且 https://developers.google.com/drive/web/batch 表示:

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

哪个值是正确的?


关于其他人的更多信息 APIs :

对于https://developers.google.com/webmaster-tools/v3/how-tos/batch 他们忘记提供主机名( www.googleapis.com ?)。在他们刚刚放的例子中:

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

对于https://developers.google.com/admin-sdk/reseller/v1/how-tos/batch 他们在示例中显示:

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

他们说限制是 1000 并指定:

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

经过实验,不可能 可以在同一批次中混合不同的 API(日历、驱动器...)。所以每个 API 都有自己的限制。

而且,对于 google 日历,还有另一个限制:

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

(错误“400 错误请求”,原因 "cannotOperateOnDifferentCalendarsInBatch")