驱动器API共享RateLimitExceeded错误

驱动器API共享RateLimitExceeded错误

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

问题描述

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

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\"" }

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

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\"" }

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

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.

文档处理API错误

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

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"
 }
}

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

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).

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

08-19 14:58