# Network communication detection

Debugging Tools

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

To help developers troubleshoot callback connection failures, this network detection API is provided.It can do domain name resolution to the developer URL, and then ping all IPs once, getting packet loss and time.

# 1. How to call

# HTTPS calls

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

# Cloud Calls

  • This interface does not support cloud calls

# Third party invocation

# 2. Request parameters

# Query parametersQuery String parameters

Parameter NametypeRequired to fill inIntroductions
access_tokenstringyesInterface invoke credentials, using access_token

# Request BodyRequest Payload

Parameter NametypeRequired to fill inExampleIntroductionsto enumerate
actionstringyesallDetection actions: dns (domain name resolution) / ping (ping detection) / all (all)-
check_operatorstringyesDEFAULTInspection carrier: CHINANET (Telecom) / UNICOM (China Unicom) / CAP (Tencent) / DEFAULT (automatic)CHINANET UNICOM CAP DEFAULT

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
dnsobjarrayList of DNS resolution results
pingobjarrayList of PING test results

# Res.dns(Array)Object Payload

List of DNS resolution results

Parameter NametypeIntroductions
ipstringResolved IP
real_operatorstringCorresponding IP carrier

# Res.ping(Array)Object Payload

List of PING test results

Parameter NametypeIntroductions
ipstringPing's ip, execute the command ping ip-c1-w1-q
from_operatorstringThe carrier at the source of the ping, controlled by check_operator in the request
package_lossstringPing's packet loss rate, 0% means no packet loss and 100% means all packet loss. Because only one ping is currently sent, the value is only 0% or 100% possible.

# 4. Note

There are no special considerations for this interface

# 5. Code examples

Example Requests

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

Return an 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 code

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

Error codeError DescriptionSolutions
40201invalid urlCallback not set URL
40202invalid actionIncorrect action parameters
40203invalid check_operatorIncorrect operator parameters

# 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 Third Party Platform Mobile App Website App Weixin Channels Assistant Multi-platform App