Express Query Interface
Currently provide express query interface platform is:
- Trackingmore
- Courier 100
- Express Network
The difference between different interfaces:
(1) Trackingmore support 380 courier companies, of which 55 are domestic express, the remaining 325 for International Express. The specific price is about 0.6 cents/number, new registered users can test for 12 hours free of charge.
(2) Express 100 belongs in the domestic do relatively early platform, can apply for up to 2000 times a day API call, but need to express 100 to do a friend chain. More than 2000 charges, each 0.06~0.1 yuan range.
(3) The Express network can apply for up to 500 times per day API calls, but also need to do a friend chain. More than half 0.05 yuan per time.
Application scenarios and uses of Express API
1. The most common application scenarios are as follows:
(1) E-commerce website: such as business-to-consumer, group purchase, business-to-trade, wholesale distribution stations,-to-do, local life transactions and other websites.
(2) Management system: Order Processing platform, order platform, delivery platform, distribution system, channel management system, customer management system, ERP and so on.
2. The purpose of the Express API is as follows:
(1) Once the customer logs in to the website, the logistics status of the order can be seen directly on the "My Orders" page.
(2) Automatically filter out the "signed", "difficult parts" and other status of the number, to reduce the pressure of logistics with single personnel.
(3) Change the status of the order and the trading process, such as the number changed to "signed", you can make the order can be confirmed returns and so on.
(4) Evaluation of the selection of courier companies, according to the "signed" in the odd, you can calculate the sales staff performance, and easy to deal with the settlement of cash on delivery.
(5) e-mail, SMS alert users of the latest status of the waybill, can appease the user, can also use the mail message two times marketing.
docking example
Here take Trackingmore as an example, different interface docking method is similar, all need to register, and generate their own API key. The following is an example of Trackingmore's real-time query API.
Interface supports message reception in the form of an HTTP POST
The encoding format for the request method is Utf-8
The data format of the request body part of the parameter is in JSON format
Interface Parameters
Interface Request Address
Http://api.trackingmore.com/v2/trackings/realtime
Request header Information Parameters
| Parameter name |
Type |
Description |
Whether you must |
Content-Type:
|
application/json
|
Define the data format of the request header |
Is |
|
String |
Trackingmore background access to the API |
Is |
Request Body Parameter Description
| Parameter description |
Type |
Description |
Whether you must |
tracking_number
|
String |
Check the Courier tracking number |
Is |
carrier_code
|
String |
Trackingmore definition of the Courier simple code, such as China EMS is China-ema |
Is |
Carrier_code parameter is Trackingmore own definition of express business, the simple code, the specific can be viewed here.
It is also important to note that the body part of these two parameters is required when the JSON data format. That's probably what it looks like.
1 {2 " Tracking_number " " LK664578623CN " , 3 " Carrier_code " " China-ems " 4 }
Return parameter definition
| Parameter name |
Parameter type |
Parameter description |
Are you sure you want to return the item value |
Code |
Digital |
Return code |
Successful return 200, failed with other queue error codes |
| Type |
String |
Interface type |
Successful return to Success |
| Message |
String |
Return information description |
Successfully returned succes, failed to return the queue error message |
| Data |
Json |
Inquiry into the logistics information |
Successful return of logistics information, failure to return empty |
Other status response simple codes can be seen here.
return example
{ "Meta": { "Code": $, "type": "Success", "message": "Success" }, "Data": { "Items": [{ "id": "442f798ea35749e7605d1a73d4181a01", "Tracking_number": "Re113184005hk", "Carrier_code": "hong- Kong-post "," status ":" Transit "," original_country ":" Hong Kong [CN] "," Destination_count Ry ":" Colombia "," itemtimelength ":NULL, "Origin_info": { "Weblink": "http:\/\/www.hongkongpost.hk\/", "Phone": "852 2921 2222", "Carrier_code": "Hong -kong-post "," Trackinfo ": [{ "Details": "CO", "statusdescription": "The Item (RE113184005HK) left Hong Kong-Destination on 10-oct-2015 "," Date ":" 2015-10-09 00:00 " }] }, "Destination_info": { "Weblink": "http:\/\/www.4-72.com.co\/", "Phone": "(57-1) 4722000", "Carrier_code": "Colombi A-post "," Trackinfo ": [{ "Date": "2015-10-22 20:52", "statusdescription": "Digitalizado", "Details": "CTP." CENTRO A " }, { "Date": "2015-10-22 17:02", "statusdescription": "Registro de entrega exitosa", "Det Ails ":" " }, { "Date": "2015-10-22 16:55", "statusdescription": "Entregado", "Details": "CD." MONTEVIDEO " }, { "Date": "2015-10-22 09:31", "statusdescription": "Reasignado", "Details": "CD." NORTE " }, { "Date": "2015-10-22 08:52", "statusdescription": "Reasignado", "Details": "CD." NORTE " }, { "Date": "2015-10-22 02:39", "statusdescription": "En proceso", "Details": "CTP." CENTRO A " }, { "Date": "2015-10-21 16:36", "statusdescription": "En proceso", "Details": "CTP." CENTRO A " }, { "Date": "2015-10-20 06:29", "statusdescription": "Envío recibido en la oficina de cambio internacional" , "Details": "COBOGC" }] } }] }}
PHP Access Example
$url = "Http://api.trackingmore.com/v2/trackings/realtime"; $header = Array (' Content-type:application/json ', ' trackingmore-api-key:b7a0009f-6cd2-43ee-9d1d-ed7135ad460f '); $postData = Array (' tracking_number ' = ') LK664578623CN ', ' carrier_code ' = ' china-ems '); $res = Curl_post ($url, Json_encode ($postData), $header);p Rint_r ($ RES); function Curl_post ($url, $postData, $header =array (), $cookie _file= ", $isheader =0, $proxy =", $debug =0, $autoRedirect = 0, $time =89) {$ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_post, True); Curl_setopt ($ CH, curlopt_postfields, $postData); curl_setopt ($ch, Curlopt_returntransfer, True); if (!empty ($isheader)) {Curl_ Setopt ($ch, Curlopt_header, $isheader);} curl_setopt ($ch, Curlopt_connecttimeout, 5); curl_setopt ($ch, Curlopt_timeout, $time); curl_setopt ($ch, Curlopt_ UserAgent, ' mozilla/5.0 (Windows NT 5.1; rv:44.0) gecko/20100101 firefox/44.0 '); if (!empty ($header)) {curl_setopt ($ch, C Urlopt_httpheader, $header);} if (!empty ($autoRedirect)) {curL_setopt ($ch, curlopt_followlocation, 1);} if (!empty ($cookie _file)) {//Read the cookie information stored in the file curl_setopt ($ch, Curlopt_cookiefile, $cookie _file);} if (!empty ($proxy)) {curl_setopt ($ch, Curlopt_proxy, $proxy);} curl_setopt ($ch, curlopt_encoding, ' gzip,deflate '), if (!empty ($debug)) {curl_setopt ($ch, curlopt_verbose,1); curl_ Setopt ($ch, curlopt_failonerror,true); Print_r (Curl_error ($ch)); Print_r (Curl_getinfo ($ch));} $html = curl_exec ($ch); Curl_close ($ch); return $html;}
Express Query API Interface (TRACKINGMORE)