Network Communication Detection

View llm.txt

Last edited on 2026-03-02

This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.

API English Name: callbackCheck

To assist developers in troubleshooting callback connection failures, this network detection API is provided. It performs domain name resolution on the developer's URL and then sends a ping request to all IPs to obtain packet loss rates and latency.

1. Call Method

HTTPS Call

POST https://api.weixin.qq.com/cgi-bin/callback/check?access_token=ACCESS_TOKEN

Cloud Call

  • This API does not support cloud call.

Third-party Call

2. Request Parameters

Query Parameters Query String Parameters

ParameterTypeRequiredDescription
access_tokenstringYesAPI call credential, you can use access_token (Supplier), component_access_token (Service Provider), authorizer_access_token (Service Provider Proxy Call)

Request Body Request Payload

ParameterTypeRequiredExampleDescriptionEnum
actionstringYesallDetection actions: dns (domain name resolution)/ping (ping detection)/all (all)-
check_operatorstringYesDEFAULTDetection operators: CHINANET (China Telecom)/UNICOM (China Unicom)/CAP (Tencent)/DEFAULT (automatic)CHINANET UNICOM CAP DEFAULT

3. Response Parameters

Response Body Response Payload

ParameterTypeDescription
dnsobjarrayList of DNS resolution results
pingobjarrayList of ping detection results

Res.dns(Array) Object Payload

List of DNS resolution results

ParameterTypeDescription
ipstringResolved IPs
real_operatorstringISP corresponding to each IP

Res.ping(Array) Object Payload

List of ping detection results

ParameterTypeDescription
ipstringIPs used for ping tests; the command executed is ping ip –c 1-w 1 -q
from_operatorstringISP of the ping source, controlled by the check_operator in the request
package_lossstringPing packet loss rate: 0% indicates no packet loss, 100% indicates complete packet loss. Since only one ping packet is sent, the values can only be 0% or 100%.

4. Notes

No special notes for this API

5. Code Example

Request Example

{
  "action": "all",
  "check_operator": "DEFAULT"
}

Response Example

{
  "dns": [
    {
      "ip": "111.161.64.40",
      "real_operator": "UNICOM"
    },
    {
      "ip": "111.161.64.48",
      "real_operator": "UNICOM"
    }
  ],
  "ping": [
    {
      "ip": "111.161.64.40",
      "from_operator": "UNICOM",
      "package_loss": "0%",
      "time": "23.079ms"
    },
    {
      "ip": "111.161.64.48",
      "from_operator": "UNICOM",
      "package_loss": "0%",
      "time": "21.434ms"
    }
  ]
}

6. Error Codes

The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.

Error CodeError DescriptionSolution
40201invalid urlCallback URL not set
40202invalid actionIncorrect action parameter
40203invalid check_operatorIncorrect operator parameter

7. Applicable Scope

API callable status for different account types:
Mini ProgramOfficial AccountService AccountMini GameWeChat ShopAlliance AgencyInfluencerShop SupplierThird-party PlatformMobile AppWebsite AppChannels WindowMulti-platform App
✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ 〇 ✔ ✔ ✔ ✔
  • ✔:This account type can call this API。
  • 〇:Third-party platforms can use component_access_token to call. For calling on behalf of Supplier, please refer to the Call Method section。