名称 | 必填 | 类型 | 描述 | 示例 |
---|---|---|---|---|
token | true | string | 请求token,用户中心获取。 | 用户中心获取token |
number | true | string | 快递单号 | 773058962040428 |
com | string | 快递公司编号,默认自动获取,可能会失败 | ||
order | string | 查询结果排序方式,desc,asc | asc |
名称 | 描述 |
---|---|
nu | 快递编号 |
com | 快递公司 |
state | 快递状态,1正常,2派送中,3已签收,4退回,5其他问题 |
info | 快递状态内容 |
info.time | 状态更新时间 |
info.content | 状态更新内容 |
info.status | 快递状态, WAIT_ACCEPT:待揽收,ACCEPT:已揽收,TRANSPORT:运输中,DELIVERING:派件中,AGENT_SIGN:代签收,SIGN:已签收,FAILED:快递异常 |
info.status_desc | 快递状态描述 |
status | 快递状态 |
status_desc | 快递状态描述 |
快递新状态说明: WAIT_ACCEPT:待揽收,ACCEPT:已揽收,TRANSPORT:运输中,DELIVERING:派件中,AGENT_SIGN:代签收,SIGN:已签收,FAILED:快递异常
curl -X POST \
https://v2.alapi.cn/api/kd \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'token=用户中心获取token&number=773058962040428&com=&order=asc'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://v2.alapi.cn/api/kd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "token=用户中心获取token&number=773058962040428&com=&order=asc",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取token&number=773058962040428&com=&order=asc");
Request request = new Request.Builder()
.url("https://v2.alapi.cn/api/kd")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://v2.alapi.cn/api/kd"
payload = "token=用户中心获取token&number=773058962040428&com=&order=asc"
headers = {'Content-Type': "application/x-www-form-urlencoded"}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=用户中心获取token&number=773058962040428&com=&order=asc");
Request request = new Request.Builder()
.url("https://v2.alapi.cn/api/kd")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://v2.alapi.cn/api/kd"
payload := strings.NewReader("token=用户中心获取token&number=773058962040428&com=&order=asc")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
返回状态码 code
描述参照
错误码 | 说明 |
---|---|
200 | 返回200表示接口正常 |
404 | 接口地址不存在 |
422 | 接口请求失败 |
400 | 接口请求失败 |
405 | 请求方法不被允许 |
100 | token 错误 |
101 | 账号过期 |
102 | 接口请求次数超过限制 |
104 | 来源或者ip不在白名单 |
406 | 没有更多数据了 |
429 | 请求 QPS 超过限制 |
内容 | 详情 |
---|---|
客服QQ | 1830934534 |
交流群 |