限制和配额
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
限制和配额可保护 Google 基础架构,防止以不当方式使用 Enterprise License Manager API 的自动化流程。来自某个 API 的过多请求可能是由无害的拼写错误导致的,也可能是由于系统设计效率低下、进行不必要的 API 调用造成的。无论是什么原因,在来自特定来源的流量达到特定水平后,您都必须将其屏蔽,这样才能保证 Google Workspace 系统的整体健康状况。它可以确保一个开发者的行为不会对更广泛的社区产生负面影响。
在极少数情况下,如果您的 API 请求失败,您会收到 HTTP 状态代码响应。状态代码 403 包含与错误输入有关的错误消息;HTTP 状态代码 503 则包含指示超出了哪些 API 配额的错误信息。这些响应可让您的自定义应用检测这些错误并采取适当措施。
如果您的请求需要在固定时间段内完成,请批量发送这些请求。根据 API 的用途,如果请求数量过高,将会发生配额错误。
如果您无法使用建议的 API 批量请求功能,请使用指数退避算法。对于基于时间的所有错误(每个线程最多 X 秒 N 个错误),尤其是 503 状态代码错误,我们建议您的代码捕获异常,并使用指数退避算法算法,等待一小段延迟后再重试失败的调用。例如,一个线程的 Enterprise License Manager API 需要等待 5 秒,然后重试失败的调用。如果请求成功,则对其他线程重复此模式。如果第二个请求未成功,您的应用应缩减请求频率,直到调用成功为止。例如,将最初的 5 秒延迟增加到 10 秒,然后再次重试失败的呼叫。此外,还需决定重试限制。例如,在您的应用向用户返回错误之前,使用不同的延迟时间重试请求 5 到 7 次。
API 配额类别 |
配额 |
每秒查询数 (QPS) |
QPS 配额为 1。 |
API 限制类别 |
限制 |
maxResults 查询字符串 |
maxResults 的大小上限为 100。 |
其他类型的限制 |
限制和准则 |
批处理请求
|
此 API 支持发送批量请求。 |
API 响应中的数据格式 |
响应的数据格式为 JavaScript 对象表示法 (JSON)。 |
启用 Enterprise License Manager API |
在调用 Enterprise License Manager API 之前,必须先启用 Provisioning API。在控制台中,转到 用户和群组 标签的“设置”页面,然后启用配置 API。保存您所做的更改。此外,您必须启用并激活 Google 网上论坛服务。
|
未经授权的请求 |
此 API 不接受任何未经授权的请求。如果未提供授权令牌,请求会被视为未授权。如需了解详情,请参阅向请求授权
。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[],[],null,["# Limits and Quotas\n\nLimits and quotas protect the Google infrastructure from an automated process that uses the Enterprise License Manager 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 [batched together](/workspace/admin/licensing/v1/how-tos/batch). Depending upon your API's purpose and if the number of requests gets too high, quota errors will occur.\n\nIf you are not able to use the recommended API batched requests feature, use the exponential backoff algorithm. For 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://wikipedia.org/wiki/Truncated_binary_exponential_backoff) algorithm, wait for a small delay before retrying the failed call. A Enterprise License Manager 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| Queries per second (QPS) | The QPS quota is 1. |\n\n| API Limit Categories | Limits |\n|-------------------------|------------------------------------------|\n| maxResults query string | The maximum size of a maxResults is 100. |\n\n| Other Types of Limits | Limitations and Guidelines |\n|---------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Batch requests | The API supports sending [batch requests](/workspace/admin/licensing/v1/how-tos/batch). |\n| Data format in API responses | The response's data format is Javascript Object Notation ([JSON](http://json.org/)). |\n| Enabling the Enterprise License Manager API | The Provisioning API has to be enabled before making calls to the Enterprise License Manager API. In your control panel, go to the Users and groups tab's Settings page and enable the Provisioning API. Save your changes. In addition, the Google Groups service must be enabled and activated. |\n| Unauthorized requests | The API does not accept any unauthorized requests. A request is considered unauthorized if no authorization token is provided. For more information, see [Authorizing Requests.](/workspace/admin/licensing/v1/how-tos/authorizing) |"]]