google-api - 针对不同 API 和限制的 Google API 和批处理请求

标签 google-api google-calendar-api

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

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

根据 https://developers.google.com/google-apps/calendar/batchhttps://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.



哪个值是正确的?

有关其他 API 的更多信息:

对于 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 都有自己的限制。

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

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



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

关于google-api - 针对不同 API 和限制的 Google API 和批处理请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30098807/

相关文章:

对 Google 云端硬盘的 Python 请求

google-api - 用于在环聊聊天中创建房间的 Rest api

ruby - Google-api-ruby-client 翻译 API 示例

php - 使用php将事件插入谷歌日历

java - 谷歌日历API删除 future 事件

javascript - Google Calendar API V3 获取与会者和创建者 java 脚本问题

google-api - 如何为 Google OAuth 2 添加多个重定向 URI?

php - 谷歌日历 API - PHP

parsing - 您认为 Google 日历中的 "Quick Add"功能如何运作?

google-calendar-api - 更新谷歌事件时出错