1. 描述
一个判断网络,获取客户端ip的接口。这个接口调通,就表明地球号的api服务正常。
2. URL
GET:http://api.svkernel.xdua.com/ping
3. 返回参数
名称 | 位置 | 类型 | 示例 | 说明 |
---|---|---|---|---|
id | result | string | 51C666DD-5CB8-4C70-94CA-BDDA1B1F08BE | 请求的id |
ip | result | string | 111.14.94.187 | 请求发起端的ip |
ua | result | string | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 Edg/91.0.864.41" | 请求发起端的ip |
time | result | string | "2021-06-22T15:09:45Z" | 服务端接到请求的GMT时间,不是北京时间。 |
4. 错误码
错误码 | 理由 | 说明 |
---|---|---|
0 | success | 成功 |
其它 | reason字段 | 错误 |
5. 示例
{
apis: "GetPing", //这个字段是常数,是本API的名字
apid: "B93A8BBD-08C0-48AA-9CC1-10577AE09AEF", //这是本API的请求ID
error: 0 //0就是成功,非0就是失败。
reason: "success", //成功,当error非0时,表达失败的原因。
result: {
ip: "111.14.94.187", //客户端公网出口的ip
time: "2021-06-23T02:25:12Z", //请求的GMT时间,格林威治的时间,离北京时间整整相聚8个小时,加8小时,就是北京时间。
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36"
},
debug: [],
}