# 使用AppSecret重置 API 调用次数

接口应在服务器端调用,详细说明参见服务端API

# 接口说明

# 接口英文名

clearQuotaByAppSecret

# 功能描述

本接口用于清空公众号/小程序等接口的每日调用接口次数

# 注意事项

1、该接口通过appsecret调用,解决了accesss_token耗尽无法调用重置 API 调用次数 的情况

2、每个账号每月使用重置 API 调用次数 与本接口共10次清零操作机会,清零生效一次即用掉一次机会;

3、由于指标计算方法或统计时间差异,实时调用量数据可能会出现误差,一般在1%以内

4、该接口仅支持POST调用

5、如果要清除getComponentAccessToken调用次数或者以服务商身份代商家清除公众号或者小程序调用次数,则需要使用clearComponentQuotaByAppSecret

# 调用方式

# HTTPS 调用


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

# 请求参数

属性 类型 必填 说明
appid string 要被清空的账号的appid
appsecret string 唯一凭证密钥,即 AppSecret,获取方式同 appid

# 返回参数

属性 类型 说明
errcode number 错误码
errmsg string 错误信息

# 调用示例

示例说明: post请求

# 请求数据示例


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

# 返回数据示例


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

# 错误码

错误码 错误码取值 解决方案
-1 system error 系统繁忙,此时请开发者稍候再试
40013 invalid appid 不合法的 AppID ,请开发者检查 AppID 的正确性,避免异常字符,注意大小写
41004 appsecret missing 缺少 secret 参数
41002 appid missing 缺少 appid 参数
48006 forbid to clear quota because of reaching the limit api 禁止清零调用次数,因为清零次数达到上限