Google云端硬盘API-权限-已超出速率限制。用户消息:对不起,您已经超出了共享配额

zde*_*enr 3 google-drive-api

我一直在使用Google Drive API以编程方式创建和共享文档。昨天我开始收到此错误消息,其中包含插入权限的每个请求:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
     "domain" : "usageLimits",
     "location" : "user.sharing",
     "locationType" : "other",
     "message" : "Rate limit exceeded. User message: \"Sorry, you have exceeded your sharing quota.\"",
     "reason" : "userRateLimitExceeded"
     } ],
  "message" : "Rate limit exceeded. User message: \"Sorry, you have exceeded your sharing quota.\""
}
Run Code Online (Sandbox Code Playgroud)

我仍然可以通过编程方式创建文档,但是插入权限的请求始终失败。

这是通过服务帐户完成的,其想法是服务帐户将管理应用程序的这些文档并根据需要与授权用户共享。

在大约50至100个权限之间插入某个位置后,该错误开始发生。我已经做过一些研究,听起来Google Drive API中可能存在“功能”,它限制了可以插入的权限数量。有没有办法解决这个限制?


更新:

作为记录,我每天能够创建51个权限。创建第52个权限始终会在24小时内失败。不幸的是,此限制使权限API完全无法用于服务帐户。

lac*_*cco 5

正如@zdegenr所述,我还体验到每24小时只能创建约50个权限。我可以通过禁用通过以下sendNotificationEmails参数发送通知电子邮件来解决此问题:https : //developers.google.com/drive/v2/reference/permissions/insert

使用此配置,我不再达到配额...