# Query API Call Quota
Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide
Interface name: getApiQuota
This interface is used to query Official Account / Service Account / Weixin Mini Program/ MiniGame / Weixin Store / Delivery Assistant / Weixin Channels Assistant / Alliance Shipping Agency / Mobile App / Website App / Weixin Mini Program / Weixin Mini Program Wait for the daily calls of the interface, the number of calls, and the frequency limit.
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/cgi-bin/openapi/quota/get?access_token=ACCESS_TOKEN
# Cloud Calls
- This interface does not support cloud calls
# Third party invocation
This interface supports Third Party Platform calling itself using component_access_token , and also supports calling on behalf of merchants.
Once the service provider has any set of permissions authorized, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.
# 2. Request parameters
# Query parametersQuery String parameters
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
access_token | string | yes | Interface invocation credentials, using access_token , component_access_token |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
cgi_path | string | yes | The request address of the api, such as "/ cgi-bin / message / custom / send";Don't prefix "https://api.weixin.qq.com" and don't leave out "/," otherwise you will get 76003 error. |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
errcode | number | Return code |
errmsg | string | Error message |
quota | object | Quota Details |
rate_limit | object | General call frequency limit |
component_rate_limit | object | Recall frequency limits |
# Res.quotaObject Payload
Quota Details
Parameter Name | type | Introductions |
---|---|---|
daily_limit | number | Number of times that account can call the interface that day |
used | number | Number of times that day had been called |
remain | number | Number of calls remaining that day |
# Res.rate_limitObject Payload
General call frequency limit
Parameter Name | type | Introductions |
---|---|---|
call_count | number | Number of calls that can be invoked in a cycle, in units |
refresh_second | number | Update cycle, in seconds |
# Res.component_rate_limitObject Payload
Recall frequency limits
Parameter Name | type | Introductions |
---|---|---|
call_count | number | Number of calls that can be invoked in a cycle, in units |
refresh_second | number | Update cycle, in seconds |
# 4. Note
If the API of the query belongs to Official Account, the access_token of the Official Account message template shall be used;If the API of the query belongs to the Weixin Mini Program interface, the access_token](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html) of the [Mini Program is required;If the query interface belongs to the interface of Third Party Platform, use third party platform component_access_token ;And so on.
If the query interface belongs to the Third Party Platform interface but is used for Official Account / Weixin Mini Program,A third party platform authorizer_access_token
If it is a third-party service provider Official Account / Service Account / Weixin Mini Program / Weixin Store / Delivery Assistant / Weixin Channels AssistantQuery interface, you need to use authorizer_access_token
Each interface has a limit on the number of calls, so the developer is asked to call the interface reasonably.
4, "/ xxx / sns / xxx" this kind of interface does not support the use of the interface, there will be 76022 error.
5, if the interface document has a separate explaination of the interface of the special quota number and logic, then the explaination of each interface interface document shall prevail.
# 5. Code examples
Example Requests
{
"cgi_path": "/wxa/gettemplatedraftlist"
}
Return an example
{
"errcode": 0,
"errmsg": "ok",
"quota": {
"daily_limit": 0,
"used": 0,
"remain": 0
}
}
# 6. Error code
The following is a list of error codes for this interface, other error codes can refer to General error codes
Error code | Error Description | Solutions |
---|---|---|
0 | ok | ok |
76021 | cgi_path not found, please check | Cgi_path is filled in incorrectly |
76022 | could not use this cgi_path,no permission | The token used by the current calling interface does not match the account owned by the api. |
# 7. Scope of application
Weixin Mini Program | Official Account | Service Account | MiniGame | Weixin Store | Alliance Shipping Agency | Delivery Assistant | Third Party Platform | Mobile App | Website App | Weixin Channels Assistant | Multi-platform App |
---|---|---|---|---|---|---|---|---|---|---|---|
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | 〇 | ✔ | ✔ | ✔ | ✔ |
- ✔: The account can call this interface
- 〇: Third Party Platform can be invoked using component_access_token . See this document for support for invoking on behalf of the merchant Methods of Invoking sections