我一直在使用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完全无法用于服务帐户。