# Query API call quota

Debugging tools

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

getApiQuota

# Functional description

This interface is used to query Official Account message template/Mini Program/The number of daily calls to interfaces such as third-party platforms and the number of calls

# Note

  1. If the API of the query belongs to the interface of the Official Account message template, you need to useAccess to the Official Account message template_TokenIf the api of the query is the interface of the Mini Program, you need to use theAccess to Mini programs_TokenIf the query is an interface of a third-party platform, you need to use theComponent of the third-party platform_access_Token

2, if it is a third-party service provider on behalf of the Official Account message template or Mini Program query the Official Account message template or Mini Program api, you need to useauthorizer_access_Token

3, each interface has a limit on the number of calls, please developers reasonable call interface

4、”/xxx/sns/xxx “This type of interface does not support the use of this interface, and a 76022 error will occur.

  1. if the business api defines the quota on the business, then the quota of the business api shall prevail

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/cgi-bin/OpenAPI/quota/get?access_token=ACCESS_TOKEN 

# Third Party Invocation

  • The calling method and parameters are the same as HTTPS, only the calling token is different

# Request parameters

attribute type Required Introductions
access_Token string yes Interface invokes the certificate, which is URL Parameters, non Body Parameters. useaccess_Tokenorauthorizer_access_Token
cgi_path string yes The request address of the api, such as "/cgi-bin/message/custom/send "Do not prefix “https://api.weixin.qq.com” , and don't leave out "/" Otherwise, the error will be 76003.

# Return parameters

attribute typeIntroductions
errcode number Return code
errmsg string Error message
quota object Quota Details
attribute type Introductions
daily_limit number The number of times the account can call this interface on the day
used number Number of calls already made that day
remain number Number of calls remaining for the day

# Call Example

Example Dxplaination: Sample request:

# Sample Request Data


{
"cgi_path":"/wxa/gettemplatedraftlist"
} 

# Return Data Example


{
  "errcode": 0,
  "errmsg": "ok",
  "quota":{
    "daily_limit": 0,
    初始值 0,
    "remain": 0
  }
} 

# Error code

Error code Error code 初始值
0 ok ok
76021 cgi_path not found, please check cgi_The path is wrong.
76022 could not use this cgi_path,no permission The token used by the current calling interface does not match the account of the api, see the notes for details