阿里express快递查询_查询快递接口

(5) 2024-08-09 17:23

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说
阿里express快递查询_查询快递接口,希望能够帮助你!!!。

【快递查询api,快递物流自动单号识别】可查询快递物流信息近500+家全国快递查询API,1个单号,自动识别,包括:顺丰、申通、圆通、韵达、中通、汇通、EMS、天天、国通、德邦、宅急送等几百家快递物流查询接口。

阿里express快递查询_查询快递接口_https://bianchenghao6.com/blog__第1张

 php案例

<?php $host = "https://wuliu.market.alicloudapi.com";//api访问链接 $path = "/kdi";//API访问后缀 $method = "GET"; $appcode = "83359fd73fexxxxxxxxxxxxx";//替换成自己的阿里云appcode $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); $querys = "no=4&type=zto"; //参数写在这里 $bodys = ""; $url = $host . $path . "?" . $querys;//url拼接 $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); //curl_setopt($curl, CURLOPT_HEADER, true); 如不输出json, 请打开这行代码,打印调试头部状态码。 //状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误 if (1 == strpos("$".$host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } echo(curl_exec($curl)); ?>

 

java案例

public static void main(String[] args) { String host = "https://wuliu.market.alicloudapi.com"; String path = "/kdi"; String method = "GET"; System.out.println("请先替换成自己的AppCode"); String appcode = "fd73fexxxxxxxx"; // !!!替换填写自己的AppCode 在买家中心查看 Map<String, String> headers = new HashMap<String, String>(); headers.put("Authorization", "APPCODE " + appcode); //格式为:Authorization:APPCODE 83359fd73fef570e3c139xxx Map<String, String> querys = new HashMap<String, String>(); querys.put("no", "4");// !!! 请求参数 querys.put("type", "zto");// !!! 请求参数 //JDK 1.8示例代码请在这里下载: http://code.fegine.com/Tools.zip try { /** * 重要提示如下: * HttpUtils请从 * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java * 或者直接下载: * http://code.fegine.com/HttpUtils.zip * 下载 * * 相应的依赖请参照 * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml * 相关jar包(非pom)直接下载: * http://code.fegine.com/aliyun-jar.zip */ HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); //System.out.println(response.toString());如不输出json, 请打开这行代码,打印调试头部状态码。 //状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误 //获取response的body System.out.println(EntityUtils.toString(response.getEntity())); //输出json } catch (Exception e) { e.printStackTrace(); } }

 

 正常返回示例

{ "status": "0",/* status 0:正常查询 201:快递单号错误 203:快递公司不存在 204:快递公司识别失败 205:没有信息 207:该单号被限制,错误单号 */ "msg": "ok", "result": { "number": "8", "type": "zto", "list": [{ "time": "2018-03-09 11:59:26", "status": "【石家庄市】快件已在【长安三部】 签收,签收人: 本人,感谢使用中通快递,期待再次为您服务!" }, { "time": "2018-03-09 09:03:10", "status": "【石家庄市】 快件已到达 【长安三部】(0311-),业务员 容晓光() 正在第1次派件, 请保持电话畅通,并耐心等待" }, { "time": "2018-03-08 23:43:44", "status": "【石家庄市】 快件离开 【石家庄】 发往 【长安三部】" }, { "time": "2018-03-08 21:00:44", "status": "【石家庄市】 快件到达 【石家庄】" }, { "time": "2018-03-07 01:38:45", "status": "【广州市】 快件离开 【广州中心】 发往 【石家庄】" }, { "time": "2018-03-07 01:36:53", "status": "【广州市】 快件到达 【广州中心】" }, { "time": "2018-03-07 00:40:57", "status": "【广州市】 快件离开 【广州花都】 发往 【石家庄中转】" }, { "time": "2018-03-07 00:01:55", "status": "【广州市】 【广州花都】(020-) 的 马溪 () 已揽收" }], "deliverystatus": "3", /* 0:快递收件(揽件)1.在途中 2.正在派件 3.已签收 4.派送失败 5.疑难件 6.退件签收 */ "issign": "1", /* 1.是否签收 */ "expName": "中通快递", /* 快递公司名称 */ "expSite": "www.zto.com", /* 快递公司官网 */ "expPhone": "95311", /* 快递公司电话 */ "courier": "容晓光", /* 快递员 或 快递站(没有则为空)*/ "courierPhone":"", /* 快递员电话 (没有则为空) */ "updateTime":"2019-08-27 13:56:19", /* 快递轨迹信息最新时间 */ "takeTime":"2天20小时14分", /* 发货到收货消耗时长 (截止最新轨迹) */ "logo":"http://img3.fegine.com/express/zto.jpg" /* 快递公司LOGO */ } }

失败返回示例

{ "status": "205", /* status状态码见产品详情 */ "msg": "没有信息", "result": { "number": "1111ADECD1234", "type": "AUTO", "list": [] } }

阿里express快递查询_查询快递接口_https://bianchenghao6.com/blog__第2张

今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

上一篇

已是最后文章

下一篇

已是最新文章

发表回复