歡迎來(lái)到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁(yè) 裝配圖網(wǎng) > 資源分類(lèi) > DOCX文檔下載  

免費(fèi)快遞查詢(xún)接口文檔

  • 資源ID:158977539       資源大小:45.45KB        全文頁(yè)數(shù):12頁(yè)
  • 資源格式: DOCX        下載積分:0積分
快捷下載 游客一鍵下載
會(huì)員登錄下載
微信登錄下載
三方登錄下載: 微信開(kāi)放平臺(tái)登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要0積分
郵箱/手機(jī):
溫馨提示:
用戶(hù)名和密碼都是您填寫(xiě)的郵箱或者手機(jī)號(hào),方便查詢(xún)和重復(fù)下載(系統(tǒng)自動(dòng)生成)
支付說(shuō)明:
本站最低充值0.01積分,下載本資源后余額將會(huì)存入您的賬戶(hù),您可在我的個(gè)人中心查看。
驗(yàn)證碼:   換一換

 
賬號(hào):
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會(huì)被瀏覽器默認(rèn)打開(kāi),此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁(yè)到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請(qǐng)使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無(wú)水印,預(yù)覽文檔經(jīng)過(guò)壓縮,下載后原文更清晰。
5、試題試卷類(lèi)文檔,如果標(biāo)題沒(méi)有明確說(shuō)明有答案則都視為沒(méi)有答案,請(qǐng)知曉。

免費(fèi)快遞查詢(xún)接口文檔

免費(fèi)快遞查詢(xún)接口文檔-快遞鳥(niǎo) API1. 報(bào)文及報(bào)文編碼接口提供:快遞鳥(niǎo)報(bào)文格式:Json格式請(qǐng)求方法的編碼格式(utf-8): "application/x-www-form-urlencoded;charset=utf-8"交互協(xié)議上統(tǒng)一用UTF-8,避免傳遞中文數(shù)據(jù)出現(xiàn)亂碼。2. 應(yīng)用場(chǎng)景(1)電商網(wǎng)站用戶(hù)打開(kāi)“我的訂單”時(shí)調(diào)用此API顯示物流信息詳情。(2)電商管理后臺(tái)的物流系統(tǒng),客服在對(duì)賬前查詢(xún)所有運(yùn)單的簽收狀態(tài),并追蹤問(wèn)題(3)每日調(diào)用次數(shù)限制不超過(guò)3000次,如超過(guò)該限制,可對(duì)接物流跟蹤API。(4)全流程的物流狀態(tài)跟蹤I3. 關(guān)于簽名采用 IP 認(rèn)證加簽名的方式對(duì)接,具體方案如下:1)防止數(shù)據(jù)被篡改在POST請(qǐng)求中會(huì)傳遞5個(gè)必須(R)參數(shù)RequestData=S據(jù)內(nèi)容(URL 編碼:UTF-8)EBusinessID=用戶(hù) IDRequestType=i請(qǐng)求指令類(lèi)型DataSign=數(shù)據(jù)內(nèi)容簽名:把(請(qǐng)求內(nèi)容(未編碼)+ApiKey)進(jìn)行MD5加密,然后Base64編 碼,最后進(jìn)行URL(utf-8)編碼。8上8丁丫卩6=返回?cái)?shù)據(jù)類(lèi)型(2-json)注:DataSign 生成后,對(duì)方接收到數(shù)據(jù)后,以同樣的算法進(jìn)行簽名,生成摘要,對(duì)比兩者的摘 要是否相同,如果不同,說(shuō)明傳遞過(guò)程中發(fā)生數(shù)據(jù)篡改。2)調(diào)用接口的身份認(rèn)證注冊(cè)成為接口用戶(hù)后,會(huì)生成對(duì)應(yīng)的用戶(hù)ID和APIKey,用戶(hù)ID相當(dāng)于用戶(hù)名,APIKey相 當(dāng)于密碼。4. 接入步驟1)接口網(wǎng)注冊(cè)賬號(hào)成為用戶(hù);提供的用戶(hù)ID是調(diào)用接口服務(wù)的身份證明,不可更改、不可轉(zhuǎn)用,API Key是應(yīng)用訪問(wèn)API 的簽名附加密鑰,必須妥善保存。兩者關(guān)系類(lèi)似于用戶(hù)名和密碼,兩者都會(huì)在簽名和業(yè)務(wù)參 數(shù)中使用。2) 登陸用戶(hù)后臺(tái), 登陸用戶(hù)后臺(tái), 進(jìn)行 實(shí)名認(rèn)證, 并 開(kāi)通會(huì)員服務(wù);3) 根據(jù)技術(shù)文檔進(jìn)行開(kāi)發(fā)并在調(diào)試平臺(tái)測(cè)試聯(lián)調(diào); 根據(jù)技術(shù)文檔進(jìn)行開(kāi)發(fā)并在調(diào)試平臺(tái)測(cè) 試聯(lián)調(diào);API接口的DEMO(包括:.Net版本、Java版本、PHP版本)供開(kāi)發(fā)參考。4) 系統(tǒng)發(fā)布上線。 系統(tǒng)發(fā)布上線。注意:測(cè)試環(huán)境中 獲取 的測(cè)試快遞單號(hào)不可用于實(shí)際發(fā)貨。5.Demo1).NET開(kāi)發(fā)using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web;using System.Net;using System.IO;namespace KdGoldAPIpublic class KdApiSearchDemo電商IDprivate string EBusinessID = "1237100"/電商加密私鑰,注意保管,不要泄漏private string AppKey = "518a73d8-1f7f-441a-b644-33e77b49d846"/請(qǐng)求 urlprivate string ReqURL = "http:/api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx"/ <summary>/ Json 方式 查詢(xún)訂單物流軌跡/ </summary>/ <returns></returns>public string getOrderTracesByJson()stringrequestData="'OrderCode':'','ShipperCode':'SF','LogisticCode':'589707398027'"Dictionary<string, string> param = new Dictionary<string, string>(); param.Add("RequestData", HttpUtility.UrlEncode(requestData, Encoding.UTF8); param.Add("EBusinessID", EBusinessID); param.Add("RequestType", "1002");string dataSign = encrypt(requestData, AppKey, "UTF-8"); param.Add("DataSign", HttpUtility.UrlEncode(dataSign, Encoding.UTF8); param.Add("DataType", "2");string result = sendPost(ReqURL, param);/根據(jù)公司業(yè)務(wù)處理返回的信息return result;/ <summary>/ Post方式提交數(shù)據(jù),返回網(wǎng)頁(yè)的源代碼/ </summary>/ <param nameiurl"發(fā)送請(qǐng)求的 URL</param>/ <param name="param">W 求的參數(shù)集合</卩8笛口>/<returns>遠(yuǎn)程資源的響應(yīng)結(jié)果</returns>private string sendPost(string url, Dictionary<string, string> param)string result = ""StringBuilder postData = new StringBuilder();if (param != null && param.Count > 0)foreach (var p in param)if (postData.Length > 0)postData.Append("&");postData.Append(p.Key); postData.Append("=");postData.Append(p.Value);byte byteData = Encoding.GetEncoding("UTF-8").GetBytes(postData.ToString(); tryHttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.ContentType = "application/x-www-form-urlencoded" request.Referer = url;request.Accept = "*/*"request.Timeout = 30 * 1000;request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"request.Method = "POST"request.ContentLength = byteData.Length;Stream stream = request.GetRequestStream();stream.Write(byteData, 0, byteData.Length);stream.Flush();stream.Close();HttpWebResponse response = (HttpWebResponse)request.GetResponse();Stream backStream = response.GetResponseStream();StreamReader sr = new StreamReader(backStream, Encoding.GetEncoding("UTF-8");result = sr.ReadToEnd();sr.Close();backStream.Close();response.Close();request.Abort();catch (Exception ex)result = ex.Message;return result;/<summary>/電商Sign簽名/</summary>/<param name="content"> 內(nèi)容</param>/<param name="keyValue">Appkey</param>/<param name="charset">URL編碼 </param>/<returns>DataSign 簽名 </returnsprivate string encrypt(String content, String keyValue, String charset)if (keyValue != null)return base64(MD5(content + keyValue, charset), charset);return base64(MD5(content, charset), charset); /<summary>/ 字符串 MD5 加密/</summary>/<param name="str">要加密的字符串 </param>/<param name="charset"> 碼方式 < /param>/<returns> 密 文</佗35$>private string MD5(string str, string charset)byte buffer = System.Text.Encoding.GetEncoding(charset).GetBytes(str);trySystem.Security.Cryptography.MD5CryptoServiceProvider check; check = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte somme = check.ComputeHash(buffer);string ret = ""foreach (byte a in somme)if (a < 16)ret += "0" + a.ToString("X");elseret += a.ToString("X");return ret.ToLower();catchthrow;/ <summary>/ base64 編碼/ </summary>/ <param name="str"> 內(nèi)容</param>/ <param name="charset"> 碼方式 < /param>/ <returns></returns>private string base64(String str, String charset)returnConvert.ToBase64String(System.Text.Encoding.GetEncoding(charset).GetBytes(str);2)PHP 開(kāi)發(fā)<?php/電商 ID defined('EBusinessID') or define('EBusinessID', '請(qǐng)申請(qǐng) /電商加密私鑰,注意保管,不要泄漏defined('AppKey') or define('AppKey', '請(qǐng)到官網(wǎng)申請(qǐng) /請(qǐng)求 urldefined('ReqURL') or define('ReqURL', 'http:/api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx');/調(diào)用查詢(xún)物流軌跡/$logisticResult=getOrderTracesByJson();echo logisticResult;/ / post 提交數(shù)據(jù)* param string $url 請(qǐng)求 Url* param array $datas 提交的數(shù)據(jù) * return url 響應(yīng)返回的 html */function sendPost($url, $datas) * Json 方式 查詢(xún)訂單物流軌跡*/function getOrderTracesByJson()$requestData= "'OrderCode':'','ShipperCode':'YTO','LogisticCode':'12345678'"$datas = array('EBusinessID' => EBusinessID,'RequestType' => '1002','RequestData' => urlencode($requestData) ,'DataType' => '2',);$datas'DataSign' = encrypt($requestData, AppKey); $result=sendPost(ReqURL, $datas);/根據(jù)公司業(yè)務(wù)處理返回的信息return $result;$temps = array();foreach ($datas as $key => $value) $temps = sprintf('%s=%s', $key, $value);$post_data = implode('&', $temps);$url_info = parse_url($url); if(empty($url_info'port')$url_info'port'=80;$httpheader = "POST " . $url_info'path' . " HTTP/1.0rn"$httpheader.= "Host:" . $url_info'host' . "rn"$httpheader.= "Content-Type:application/x-www-form-urlencodedrn"$httpheader.= "Content-Length:" . strlen($post_data) . "rn"$httpheader.= "Connection:closernrn"$httpheader.= $post_data;$fd = fsockopen($url_info'host', $url_info'port'); fwrite($fd, $httpheader);$gets = ""$headerFlag = true;while (!feof($fd) if ($header = fgets($fd) && ($header = "rn" | $header = "n") break;while (!feof($fd) $gets.= fread($fd, 128);fclose($fd);return $gets; /* 電商 Sign 簽名生成* param data 內(nèi)容* param appkey Appkey* return DataSign 簽名*/function encrypt($data, $appkey) return urlencode(base64_encode(md5($data.$appkey); ?>3) JAVA開(kāi)發(fā)import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.io.UnsupportedEncodingException;import .HttpURLConnection;import .URL;import .URLEncoder;import java.security.MessageDigest;import java.util.HashMap;import java.util.Map;public class KdniaoTrackQueryAPI /DEMOpublic static void main(String args) KdniaoTrackQueryAPI api = new KdniaoTrackQueryAPI();try String result = api.getOrderTracesByJson("ANE", "210001633605"); System.out.print(result); catch (Exception e) e.printStackTrace();/電商 IDprivate String EBusinesslD="請(qǐng)申請(qǐng)";/電商加密私鑰,注意保管,不要泄漏private String AppKey="請(qǐng)申請(qǐng)";/請(qǐng)求 urlprivate String ReqURL="http:/api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx";/* Json 方式 查詢(xún)訂單物流軌跡* throws Exception*/public String getOrderTracesByJson(String expCode, String expNo) throws Exception String requestData= "'OrderCode':'','ShipperCode':'" + expCode + "','LogisticCode':'" + expNo + "'";Map<String, String> params = new HashMap<String, String>(); params.put("RequestData", urlEncoder(requestData, "UTF-8"); params.put("EBusinessID", EBusinessID); params.put("RequestType", "1002");String dataSign=encrypt(requestData, AppKey, "UTF-8"); params.put("DataSign", urlEncoder(dataSign, "UTF-8"); params.put("DataType", "2");String result=sendPost(ReqURL, params);/根據(jù)公司業(yè)務(wù)處理返回的信息 return result;/* MD5 加密* param str 內(nèi)容* param charset 編碼方式* throws Exception*/SuppressWarnings("unused")private String MD5(String str, String charset) throws Exception MessageDigest md = MessageDigest.getInstance("MD5"); md.update(str.getBytes(charset);byte result = md.digest();StringBuffer sb = new StringBuffer(32);for (int i = 0; i < result.length; i+) int val = resulti & 0xff;if (val <= 0xf) sb.append("0"); sb.append(Integer.toHexString(val); return sb.toString().toLowerCase();/* base64 編碼* param str 內(nèi)容* param charset 編碼方式* throws UnsupportedEncodingException*/private String base64(String str, String charset) throws UnsupportedEncodingException String encoded = base64Encode(str.getBytes(charset); return encoded;SuppressWarnings("unused")private String urlEncoder(String str, String charset) throws UnsupportedEncodingExceptionString result = URLEncoder.encode(str, charset);return result;/ 向指定 URL 發(fā)送 POST 方法的請(qǐng)求* param url 發(fā)送請(qǐng)求的 URL* param params 請(qǐng)求的參數(shù)集合* return 遠(yuǎn)程資源的響應(yīng)結(jié)果 */SuppressWarnings("unused") private String sendPost(String url, Map<String, String> params) OutputStreamWriter out = null;BufferedReader in = null;StringBuilder result = new StringBuilder();try URL realUrl = new URL(url);HttpURLConnection conn =(HttpURLConnection) realUrl.openConnection(); /發(fā)送POST請(qǐng)求必須設(shè)置如下兩行* 電商 Sign 簽名生成* param content 內(nèi)容* param keyValue Appkey* param charset 編碼方式* throws UnsupportedEncodingException ,Exception* return DataSign 簽名*/SuppressWarnings("unused")private String encrypt (String content, String keyValue, String charset) throws UnsupportedEncodingException, Exceptionif (keyValue != null)return base64(MD5(content + keyValue, charset), charset);return base64(MD5(content, charset), charset);conn.setDoOutput(true);conn.setDoInput(true);/ POST 方法conn.setRequestMethod("POST");/ 設(shè)置通用的請(qǐng)求屬性conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("user-agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");conn.connect();/ 獲取 URLConnection 對(duì)象對(duì)應(yīng)的輸出流out = new OutputStreamWriter(conn.getOutputStream(), "UTF-8");/ 發(fā)送請(qǐng)求參數(shù)if (params != null) StringBuilder param = new StringBuilder();for (Map.Entry<String, String> entry : params.entrySet() if(param.length()>0) param.append("&"); param.append(entry.getKey();param.append("=");param.append(entry.getValue(); /System.out.println(entry.getKey()+":"+entry.getValue();/System.out.println("param:"+param.toString(); out.write(param.toString();/ flush 輸出流的緩沖out.flush();/定義BufferedReader輸入流來(lái)讀取URL的響應(yīng)in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8");String line;while (line = in.readLine() != null) result.append(line); catch (Exception e) e.printStackTrace();/使用 finally 塊來(lái)關(guān)閉輸出流、輸入流finallytryif(out!=null)out.close();if(in!=null) in.close();catch(IOException ex)ex.printStackTrace();return result.toString();private static char base64EncodeChars = new char 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','I', 'J', 'K', 'L', 'M', 'N', 'O', 'P','Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X','Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f','g', 'h', 'i', 'j', 'k', 'l', 'm', 'n','o', 'p', 'q', 'r', 's', 't', 'u', 'v','w', 'x', 'y', 'z', '0', '1', '2', '3','4', '5', '6', '7', '8', '9', '+', '/' ;public static String base64Encode(byte data) StringBuffer sb = new StringBuffer();int len = data.length;int i = 0;int b1, b2, b3;while (i < len) b1 = datai+ & 0xff;if (i = len) sb.append(base64EncodeCharsb1 >>> 2); sb.append(base64EncodeChars(b1 & 0x3) << 4); sb.append("=");break;b2 = datai+ & 0xff;if (i = len) sb.append(base64EncodeCharsb1 >>> 2); sb.append(base64EncodeChars(b1 & 0x03) << 4) | (b2 & 0xf0) >>> 4); sb.append(base64EncodeChars(b2 & 0x0f) << 2);sb.append("=");break;b3 = datai+ & 0xff;sb.append(base64EncodeCharsb1 >>> 2);sb.append(base64EncodeChars(b1 & 0x03) << 4) | (b2 & 0xf0) >>> 4);sb.append(base64EncodeChars(b2 & 0x0f) << 2) | (b3 & 0xc0) >>> 6); sb.append(base64EncodeCharsb3 & 0x3f);return sb.toString();

注意事項(xiàng)

本文(免費(fèi)快遞查詢(xún)接口文檔)為本站會(huì)員(daj****de)主動(dòng)上傳,裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請(qǐng)重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話(huà):18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶(hù)上傳的文檔直接被用戶(hù)下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!