用量限额和配额
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
限制和配额可保护 Google 基础架构免受自动流程以不当方式使用 Admin Settings API 所造成的影响。来自 API 的过多请求可能是由无害的拼写错误造成的,也可能是由设计效率低下的系统进行不必要的 API 调用造成的。无论出于何种原因,只要特定来源的流量达到一定水平,就禁止来自特定来源的流量,这对于 Google Workspace 系统的整体运行状况来说十分必要。这样可确保一个开发者的行为不会对更大的社区产生负面影响。
在极少数情况下,如果您的 API 请求失败,您会收到 HTTP 状态代码响应。状态代码 403 包含有关输入错误的错误信息,HTTP 状态代码 503 则包含错误信息,指示已超出哪些 API 配额。这些响应可让您的自定义应用检测这些错误并采取相应措施。
如果您的请求需要在固定时间段内完成,请并行发送请求,或在 Java 或 C# 应用中使用多个线程。例如,按月或按照其他时间段细分您的请求。对于线程,请尝试从 10 个线程开始,每个请求一个线程。请注意,线程建议需要进行权衡,并非适用于所有 API 情况。如果请求数量过多,就会发生配额错误。
对于所有基于时间的错误(每个线程最多 X 秒,尤其是 503 状态代码错误),我们建议您的代码捕获异常,并采用指数退避算法算法稍等片刻,然后重试失败的调用。一个线程的 Email Settings API 示例是等待 5 秒钟,然后重试失败的调用。如果请求成功,请为其他线程重复此模式。如果第二个请求不成功,您的应用应按请求的频率进行缩减,直到调用成功。例如,将初始 5 秒延迟增加至 10 秒,然后再次重试失败的调用。此外,还要确定重试限制。例如,在应用返回用户错误之前,以 5 次不同的延迟重试一个请求。
API 配额类别 |
配额 |
StreetView 身份验证令牌 |
有效期为 24 小时。错误为“401 token expired”。
|
生成公钥和私钥 |
通过身份提供方,使用 DSA 或 RSA 算法生成一组公钥和私钥。公钥采用 X.509 格式的证书。要详细了解基于 SAML 的单点登录密钥,请参阅为 Google Workspace 单点登录服务生成密钥和证书。 |
徽标 |
帐号徽标图片文件可以采用 JPEG、PNG 或 GIF 格式。建议的尺寸为 143 x 59 像素,文件应小于 20 Kb。使用自定义徽标时,请务必遵守 Google 服务条款。避免使用 Google 徽标、Gmail 徽标或任何其他 Google 徽标。如需了解详情,请参阅徽标和着陆页政策。 |
sso 白名单 |
sso 白名单是无类别域间路由 (CIDR) 格式的网络掩码 IP 地址。 |
其他类型的限制 |
限制和准则 |
MX 记录验证状态 |
默认的 MX 记录验证状态是“false”,表示 Google 系统最近未检查您的 MX 记录配置,或者您的 MX 记录未配置为指向 Google 系统。如果您更新了记录,并且验证状态仍然为 false,则表示您的 MX 记录更新尚未传播,或者记录中存在拼写错误。如需传播,我们建议您等待 MX 记录的生存时间 (TTL) 指定的时间,然后重试。
|
国家/地区代码 |
如果组织名称尚未自定义,则默认域名为主域名。如需了解组织名称字符,请参阅字符使用。
|
creationTime 属性,日期和时间的数字表示形式 |
请参阅 ISO 8601,日期和时间的数字表示形式。 |
语言编码标记 |
请参阅 Google Mail 接受的 RFC 3066 语言标记。 |
组织名称 |
如果组织名称尚未自定义,则默认域名为主域名。如需了解组织名称字符,请参阅字符使用。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-25。
[null,null,["最后更新时间 (UTC):2025-03-25。"],[],[],null,["# Usage limits and quotas\n\nLimits and quotas protect the Google infrastructure from an automated process that uses the Admin Settings API in an inappropriate way. Excessive requests from an API might result from a harmless typo, or may result from an inefficiently designed system that makes needless API calls. Regardless of the cause, blocking traffic from a specific source once it reaches a certain level is necessary for the overall health of the Google Workspace system. It ensures that one developer's actions cannot negatively impact the larger community.\n\nIn the unlikely event that your API request fails, you'll receive an HTTP status code response. A status code of 403 has error information about incorrect input, and an HTTP status code of 503 has error information indicating which API quotas have been exceeded. These responses allow your custom application to detect these errors and take appropriate action.\n\nIf your requests need to be completed in a fixed period of time, send your requests in parallel or use multiple threads in your Java or C# application. For example, break your requests by month or another time period. In the case of threads, try starting with 10 threads, one thread per request. Note, the thread recommendation has tradeoffs and is not useful for all API situations. If the number of requests gets too high, quota errors will occur.\n\nFor all errors that are time based (maximum of N things for X seconds per thread), especially the 503 status code errors, we recommend your code catch the exception and, using an [exponential backoff](http://en.wikipedia.org/wiki/Truncated_binary_exponential_backoff) algorithm, wait for a small delay before retrying the failed call. A Email Settings API example for one thread is to wait 5 seconds and retry the failed call. If the request is successful, repeat this pattern for the other threads. If the second request is not successful, your application should scale back on the frequency of the request until a call is successful. For example, increase the initial 5 second delay to 10 seconds and retry your failed call again. Also, decide on a retry limit. For example retry a request 5 to 7 times with different delay times before your application returns an error to the user.\n\n| API Quota Categories | Quotas |\n|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ClientLogin authentication tokens | Valid for 24 hours. The error is '401 token expired'. |\n| Generating public and private keys | With your identity provider, generate a set of public and private keys using either the DSA or RSA algorithms. The public key is in X.509 formatted certificate. For more information about SAML-based Single Sign-On signing keys, see [Generating Keys and Certificates for Google Workspace Single Sign-On Service](/google-apps/help/articles/sso-keygen). |\n| Logo | An account's logo image file can be in JPEG, PNG, or GIF format. The recommended size is 143 x 59 pixels and the file should be smaller than 20Kb. When using custom logos, remember to stay within the Google [Terms of Service](//www.google.com/apps/intl/en/terms/standard_terms.html). And refrain from using the Google logo, Gmail logo, or any other Google logos. For more information, see [Logo and landing page policies](https://support.google.com/a/answer/96474). |\n| ssoWhitelist | A ssoWhitelist is a network mask IP address in Classless Inter-Domain Routing [(CIDR)](http://en.wikipedia.org/wiki/CIDR) format. |\n\n| Other Types of Limits | Limitations and Guidelines |\n|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| MX record verification status | The default MX record verification status is \\`false\\` which means either the Google system has not recently checked your MX record configuration or your MX records have not been configured to point to the Google systems. If you have updated your records and the verification status remains false, it can mean your MX record updates have not been propagated, or there is a typo in the record. For propagation, we recommend you wait the amount of time defined by the MX record's Time To Live value (TTL) and try again. |\n| Country codes | If the organization name has not been customized, the default is your primary domain name. For information about organization name characters, see [Character usage](https://support.google.com/a/answer/33386). |\n| `creationTime` property, numeric representation of dates and time | See the [ISO 8601](//www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/iso8601), Numeric representation of Dates and Time. |\n| Language encoding tags | See the [RFC 3066 language tags](/workspace/admin/email-settings#language_tags) accepted by Google Mail. |\n| Organization name | If the organization name has not been customized, the default is your primary domain name. For information about organization name characters, see [Character usage](https://support.google.com/a/answer/33386). |"]]