我已阅读此处的 gmail api 配额说明(https://developers.google.com/gmail/api/v1/reference/quota),但仍无法理解导致我们超出限制的原因。
问题 1:每用户配额中的用户是多少?我不确定该用户是个人 gmail 用户,还是使用 gmail api 的服务客户端。
问题 2:我们已经多次看到以下错误,但没有看到任何明显的限制。
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "rateLimitExceeded",
"message": "Rate Limit Exceeded"
}
],
"code": 429,
"message": "Rate Limit Exceeded"
}
Run Code Online (Sandbox Code Playgroud)
我们的速度低于 250 单位/秒和 25,000 单位/100 秒。我们只使用history.list和message.get调用,不发送或修改。
我还缺少其他配额吗?
Gmail API History.list 返回的 messageId 在调用 message.get 时返回 404。
我使用“INBOX”标签和“history/messagesAdded”字段调用history.list。然后,我调用 message.get 并返回每个 messageId。其中一些返回有效消息,另一些返回以下异常:
Google_Service_Exception
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
Run Code Online (Sandbox Code Playgroud)
什么会导致这种情况呢?看来我们刚刚检索了 messageId,现在没有足够的时间将它们永久删除。