跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://developers-sandbox.uqpaytech.com/llms.txt

Use this file to discover all available pages before exploring further.

API 按分钟进行限流,不同资源按客户账户维度设定不同的速率限制。以某个资源的速率限制为每分钟 10 次请求为例,同一分钟内(例如 16:20:00 至 16:21:00 之间)超过 10 次的请求都会返回错误。限流器允许突发流量,因此如果前 50 秒内没有任何请求,但接下来的 10 秒内收到 10 次请求,这些请求都会成功。 你必须在 API 客户端中对 HTTP 429 响应码实现合适的错误处理。推荐使用带随机抖动的指数退避策略来处理 HTTP 429 响应码。 不同资源根据 API 客户端是否发起已认证请求而适用不同的速率限制,如下表所示。
请求类型请求路径速率限制(Sandbox)速率限制(Production)
身份验证/api/v1/connect/token每分钟 60 次请求每分钟 100 次请求
其他所有已认证请求/api/v1/*每分钟 500 次请求每分钟 300 次请求
其他所有未认证请求/api/v1/*每分钟 200 次请求每分钟 100 次请求

超出限流

当超出速率限制时,API 将返回 HTTP 状态码 429 -- "Too Many Requests",响应体为 JSON 格式,示例如下:
HTTP/1.1 429 Too Many Requests
Date: Mon, 25 Jan 2021 13:16:59 GMT
Content-Type: application/json; charset=UTF-8
{
  "code": "too_many_requests",
  "message": "Too many requests have been made to the api. Please refer to the Developer Center for more information",
}