# Network communication detection
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
- This interface supports Third Party Platform calling itself using component_access_token .
# 2. Request parameters
# Query parametersQuery String parameters
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
access_token | string | yes | Interface invoke credentials, using access_token |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Example | Introductions | to enumerate |
---|---|---|---|---|---|
action | string | yes | all | Detection actions: dns (domain name resolution) / ping (ping detection) / all (all) | - |
check_operator | string | yes | DEFAULT | Inspection carrier: CHINANET (Telecom) / UNICOM (China Unicom) / CAP (Tencent) / DEFAULT (automatic) | CHINANET UNICOM CAP DEFAULT |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
dns | objarray | List of DNS resolution results |
ping | objarray | List of PING test results |
# Res.dns(Array)Object Payload
List of DNS resolution results
Parameter Name | type | Introductions |
---|---|---|
ip | string | Resolved IP |
real_operator | string | Corresponding IP carrier |
# Res.ping(Array)Object Payload
List of PING test results
Parameter Name | type | Introductions |
---|---|---|
ip | string | Ping's ip, execute the command ping ip-c1-w1-q |
from_operator | string | The carrier at the source of the ping, controlled by check_operator in the request |
package_loss | string | Ping'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 code | Error Description | Solutions |
---|---|---|
40201 | invalid url | Callback not set URL |
40202 | invalid action | Incorrect action parameters |
40203 | invalid check_operator | Incorrect 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 |
---|---|---|---|---|---|---|---|---|---|---|---|
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | 〇 | ✔ | ✔ | ✔ | ✔ |
- ✔: The account can call this interface
- 〇: Third Party Platform can be invoked using component_access_token . See this document for support for invoking on behalf of the merchant Methods of Invoking sections