# Reset the number of API calls with AppSecret

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: clearQuotaByAppSecret

This interface is used to empty 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 Wait for the number of interface calls per day.

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/cgi-bin/clear_quota/v2

# Cloud Calls

  • This interface does not support cloud calls

# Third party invocation

  • Third Party Platform calls are not supported by this interface.

# 2. Request parameters

# Query parametersQuery String parameters

nothing

# Request BodyRequest Payload

Parameter NametypeRequired to fill inIntroductions
appidstringyesAppID of the account to be emptied
appsecretstringyesUnique credential key, that is, AppSecret

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
errcodenumberError code
errmsgstringError message

# 4. Note

  1. This interface is called by appsecret, which solves the problem that accesses_token is exhausted and cannot call "reset the number of API calls."

2, each account uses "reset the number of API calls" and this interface a total of 10 times a month to clear the operation of the opportunity to clear the effect of once used up a chance;

  1. Due to differences in the methodology or statistical time of calculation of indicators, real-time call data may have an error, generally within 1%.

4, the interface only supports POST calls

  1. If you want to clear getComponentAccessToken The number of calls or to clear Official Account or Weixin Mini Program calls on behalf of the merchant as a service provider, you need to use clearComponentQuotaByAppSecret interface.

# 5. Code examples

Example Requests

POST  https://api.weixin.qq.com/cgi-bin/clear_quota/v2?appid=wx888888888888&appsecret=xxxxxxxxxxxxxxxxxxxxxxxx

Return an example

{
  "errcode": 0,
  "errmsg": "ok"
}

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
-1system errorThe system is busy, so the developer is asked to try again in a few minutes.
40013invalid appidInvalid AppID, please check the correctness of the AppID, avoid abnormal characters, pay attention to the case
41002appid missingMissing AppID parameter
41004appsecret missingMissing secret parameter
48006forbid to clear quota because of reaching the limitThe api disables the number of zeroing calls because the number of zeroing calls is capped

# 7. Scope of application

How this interface can be invoked under different account types:
Weixin Mini Program Official Account Service Account MiniGame Weixin Store Alliance Shipping Agency Delivery Assistant Mobile App Website App Weixin Channels Assistant Multi-platform App
  • ✔: The account can call this interface
  • Other account types that are not expressly stated may not be called on this interface without special instructions;