Reputation: 603
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.
Upvotes: 6
Views: 4164
Reputation: 116878
{ "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).
Upvotes: 5