Express tracking number query API can be connected to SF express query, postal express query, ZTO express query, etc. These express logistics companies provide express logistics such as automatic identification interfaces for express order numbers and query interfaces for express order numbers. For e-commerce companies and ERP service companies, integrating this interface into their own software increases the competitiveness of the company. But%E
package com.zs.app;
import php.io.BufferedReader;
import php.io.IOException;
import php.io.InputStreamReader;
import php.io.OutputStreamWriter;
import php.io.UnsupportedEncodingException;
import php.net.HttpURLConnection;
import php.net.URL;
import php.net.URLEncoder;
import php.security.MessageDigest;
import php.util.HashMap;
import php.util.Map;
/**
*
* Express Bird Logistics Track Instant Inquiry Interface
*
* @Technical QQ Group: 456320272
* @see:Webpage Link
* @copyright:
*
* The e-commerce ID and private key in DEMO are used for testing. Please register a separate account for the official environment.
* If the number of inquiries exceeds 500 in a single day, it is recommended to access our logistics track subscription push interface
*
* Please go to the official website to apply for ID and Key: Web link
*/
public class KdniaoTrackQueryAPI {
//DEMO
public 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();
}
}
%2return sb.toString().toLowerCase();
}
/**
* base64 encoding
* @param str content
* @param charset encoding method
* @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 UnsupportedEncodingException{
String result = URLEncoder.encode(str, charset);
return result;
}
/**
* E-commerce Sign signature generation
* @param content content
* @param keyValue Appkey
* @param charset encoding method
* @throws UnsupportedEncodingException,Exception
* @return DataSign sign
*/
@SuppressWarnings("unused")
private String encrypt (String content, String keyValue, String charset) throws UnsupportedEncodingException, Exception
{
if (keyValue != null)
{
return base64(MD5(content keyValue, charset), charset);
}
return b// Define the BufferedReader input stream to read the response of the URL
in = new BufferedReader(
new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
} catch (Exception e) {
e.printStackTrace();
}
//Use finally block to close the output stream and input stream
finally{
try{
if(out!=null){
out.close();
}
if(in!=null){
in.close();
}
}
catch(IOException ex){
ex.printStackTrace();
}
}
return result.toString();
}
private stati