gpt4 book ai didi

google-api - Drive API共享RateLimitExceeded错误

转载 作者:行者123 更新时间:2023-12-03 02:41:31 25 4
gpt4 key购买 nike

我们有一个应用程序,可以使用 Drive API 管理 Google 云端硬盘文件和文件夹的共享权限。当我们的应用程序尝试更新某些文件或文件夹的共享设置时,我们收到“sharingRateLimitExceeded”错误:

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 调用配置为不发送电子邮件,并且我们的服务帐户在更改权限时会模拟不同的用户,以避免超出速率限制。

我们如何找出超出了哪个共享限制?一旦我们知道超出了哪个共享限制,我们在哪里可以找到该共享限制有多高?是每分钟共享限制还是每天共享限制?我们需要有关错误的更多信息,以便我们可以调整脚本,以便不再超出共享限制。有关错误的信息在 documentation仅限于对我们有任何值(value)。

最佳答案

{   "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 个,您似乎已达到该配额。它应该在美国西部时间午夜重置。

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

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

关于google-api - Drive API共享RateLimitExceeded错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46844246/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com