Drive API 共享RateLimitExceeded 错误 [英] Drive API sharingRateLimitExceeded error

查看:33
本文介绍了Drive API 共享RateLimitExceeded 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序使用 Drive API 管理 Google Drive 文件和文件夹的共享权限.当我们的应用程序尝试更新某些文件或文件夹的共享设置时,我们会收到sharingRateLimitExceeded"错误:

引起:com.google.api.server.spi.response.UnauthorizedException: 403 FORBIDDEN { "code" : 403, "errors" : [ {域":全球","message" : "超出速率限制.用户消息:"由于超出速率限制,无法共享这些项目:SupportMenuItem.class"","reason" : "sharingRateLimitExceeded" } ], "message" : "超出速率限制.用户消息:"这些项目无法共享,因为超出了速率限制:FILENAME"" }

我们已经将 API 调用配置为不发送电子邮件,并且我们的服务帐户在更改权限时会模拟不同的用户以避免超出速率限制.

我们如何确定超出了哪个共享限制?一旦我们知道超出了哪个共享限制,我们在哪里可以找到共享限制有多高?是每分钟分享限制还是每天分享限制?我们需要有关错误的更多信息,以便我们可以调整我们的脚本,以便不再超过共享限制.文档中的错误信息仅限于对我们有任何价值.

解决方案

{ "code" : 403, "errors" : [ {域":全球","message" : "超出速率限制.用户消息:"由于超出速率限制,无法共享这些项目:SupportMenuItem.class"","reason" : "sharingRateLimitExceeded" } ], "message" : "超出速率限制.用户消息:"这些项目无法共享,因为超出了速率限制:FILENAME"" }

一天可以插入多少权限是有限制的.在 24 小时内大约有 50 个,您似乎已经达到了该配额.它应该在午夜西部花费美国时间重置.

据我所知,无法延长此配额.

文档处理 API 错误

<块引用>

403:超出共享速率限制

用户已达到共享限制.这通常与电子邮件限制相关联.

<代码>{错误": {错误":[{域":全球","message": "超出速率限制.用户消息:"由于超出速率限制,无法共享这些项目:文件名","原因": "sharingRateLimitExceeded",}],代码":403,消息":超出速率限制"}}

<块引用>

建议的操作:

共享大量文件时不要发送电子邮件.如果一个用户代表 G Suite 域的多个用户发出大量请求,请考虑使用 服务帐户 具有授权以模拟要共享的每个文档的所有者(设置 quotaUser 参数).

We have an application that manages the sharing permission for Google Drive files and folders using the Drive API. When our application tries to update the sharing settings of certain files or folders we get a 'sharingRateLimitExceeded' error:

Caused by: com.google.api.server.spi.response.UnauthorizedException: 403 FORBIDDEN {   "code" : 403,   "errors" : [ {
    "domain" : "global",
    "message" : "Rate limit exceeded. User message: "These item(s) could not be shared because a rate limit was exceeded: SupportMenuItem.class"",
    "reason" : "sharingRateLimitExceeded"   } ],   "message" : "Rate limit exceeded. User message: "These item(s) could not be shared because a rate limit was exceeded: FILENAME"" }

We already configured the API call to not send emails and our service account impersonates different users when changing permissions to avoid exceeding rate limits.

How do we find out which sharing limit is being exceeded? And once we know which sharing limit is being exceeded, where can we find how high that sharing limit is? Is it a per minute sharing limit or a per day sharing limit? We need more information on the error so we can adjust our script so the sharing limits are not exceeded anymore. The information on the error in the documentation is to limited to be of any value to us.

解决方案

{   "code" : 403,   "errors" : [ {
        "domain" : "global",
        "message" : "Rate limit exceeded. User message: "These item(s) could not be shared because a rate limit was exceeded: SupportMenuItem.class"",
        "reason" : "sharingRateLimitExceeded"   } ],   "message" : "Rate limit exceeded. User message: "These item(s) could not be shared because a rate limit was exceeded: FILENAME"" } 

There is a limit to how many permissions you can insert in a day. That being around 50 in a 24 hour period of time you appear to have hit that quota. It should reset at mid night west cost usa time.

To my knowledge there is no way to extend this quota.

Documentation Handeling API errors

403: Sharing Rate Limit Exceeded

The user has reached a sharing limit. This is often linked with an email limit.

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "message": "Rate limit exceeded. User message: "These item(s) could not be shared because a rate limit was exceeded: filename",
    "reason": "sharingRateLimitExceeded",
   }
  ],
  "code": 403,
  "message": "Rate Limit Exceeded"
 }
}

Suggested actions:

Do not send emails when sharing lot of files. If one user is making a lot of requests on behalf of many users of a G Suite domain, consider a Service Account with authority delegation to impersonate the owner of each document to share (setting the quotaUser parameter).

这篇关于Drive API 共享RateLimitExceeded 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆