TrackingMore API

Java Class Example 

  • De klasse van api
    //www.trackingmore.com/api-class_java.html

    Installatie:
    1. download deze klasse naar de gewenste locatie
    2. Vul in Trackingmore-Api-sleutel in deze klasse in lijn "beschermd $apiKey ="UW API-SLEUTEL";"
    3. eisen van deze klasse in uw project. Net als:
    require('/Path/trackingmore/class.php');


    Lijst van alle luchtvaartmaatschappijen
    String urlStr = null;
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"carriers");
    
    Detect a carrier by tracking code
    String urlStr = null;
    String requestData="{\"tracking_number\":\"EA152563251CN\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"carriers/detect");
    
    Lijst van alle trackings
    String urlStr ="?page=1&limit=100&created_at_min=1521314361&created_at_max=1541314361&update_time_min=1521314361&update_time_max=1541314361&order_created_time_min=1521314361&order_created_time_max=1541314361&numbers=1212121,UG586285221CN&orders=123&lang=cn";
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"get");
    
    Een tracking-item maken
    String urlStr =null;
    String requestData= "{\"tracking_number\": \"EA152563254CN\",\"carrier_code\":\"china-ems\",\"title\":\"chase chen\",\"customer_name\":\"chase\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123\",\"order_create_time\":\"2018-05-20 12:00\",\"destination_code\":\"IL\",\"tracking_ship_date\":\"1521314361\",\"tracking_postal_code\":\"13ES20\",\"lang\":\"en\",\"logistics_channel\":\"4PX page\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"post");
    
    Maak meerdere trackings.
    String urlStr =null;
    String requestData="[{\"tracking_number\": \"RM131516216CN\",\"carrier_code\":\"china-ems\",\"title\":\"chase chen\",\"customer_name\":\"chase\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123444\",\"order_create_time\":\"2018-05-20 12:00\",\"destination_code\":\"IL\",\"tracking_ship_date\":\"1525314361\",\"tracking_postal_code\":\"13ES20\",\"lang\":\"en\",\"logistics_channel\":\"4PX page\"},{\"tracking_number\": \"RM111516216CN\",\"carrier_code\":\"china-ems\",\"title\":\"chase chen\",\"customer_name\":\"chase\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123444\",\"order_create_time\":\"2018-05-20 12:00\",\"destination_code\":\"IL\",\"tracking_ship_date\":\"1521314361\",\"tracking_postal_code\":\"13ES20\",\"lang\":\"en\",\"logistics_channel\":\"4PX page1\"}]";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"batch");
    
    Bijhouden van resultaten van een enkele tracking ophalen
    String urlStr ="/china-ems/EA166023092CN";
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"codeNumberGet");
    
    Tracking object bijwerken
    String urlStr ="/china-ems/EA166023092CN";
    String requestData="{\"title\": \"testtitle\",\"customer_name\":\"c#test\",\"customer_email\":\"[email protected]\",\"order_id\":\"#1234567\",\"logistics_channel\":\"chase chen c#\",\"customer_phone\":\"+86 13873399982\",\"destination_code\":\"US\",\"status\":\"7\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"codeNumberPut");
    
    Een tracking-item verwijderen
    String urlStr ="/china-ems/EA166023092CN";
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"codeNumberDelete");
    
    Krijg realtime tracking-resultaten van een enkele tracking
    String	urlStr =null;
    String requestData="{\"tracking_number\": \"61290983300030854514\",\"carrier_code\":\"fedex\",\"destination_code\":\"US\",\"tracking_ship_date\": \"20180226\",\"tracking_postal_code\":\"13ES20\",\"specialNumberDestination\":\"US\",\"order\":\"#123123\",\"order_create_time\":\"2018/3/27 16:51\",\"lang\":\"en\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"realtime");
    
    Meerdere tracking-item verwijderen
    String	urlStr =null;
    String requestData= "[{\"tracking_number\":\"EA152563242CN\",\"carrier_code\":\"china-ems\"},{\"tracking_number\":\"EA152563254CN\",\"carrier_code\":\"china-ems\"}]";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"delete");
    
    Courier-code wijzigen
    String	urlStr =null;
    String requestData="{\"tracking_number\": \"EA152563242CN\",\"carrier_code\":\"dhl\",\"update_carrier_code\":\"china-ems\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"update");
    
    Gebruikersinfo krijgen
    String	urlStr =null;
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"getuserinfo");
    
    Status-nummer krijgen
    String	urlStr =null;
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"getstatusnumber");
    
    Batch niet bij te werken met het object bijhouden
    String	urlStr =null;
    String requestData= "[{\"tracking_number\":\"LK032051658CN\",\"carrier_code\":\"china-ems\"},{\"tracking_number\":\"EA166023092CN\",\"carrier_code\":\"china-ems\"}]";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"notupdate");
    
    Controleer als een zending is verzonden naar afgelegen gebied.
    String	urlStr =null;
    String requestData= "[{\"country\":\"CN\",\"postcode\":\"400422\"},{\"country\":\"CN\",\"postcode\":\"412000\"}]";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"remote");
    
    Courier veroudering resultaten te krijgen
    String	urlStr =null;
    String requestData= "[{\"carrier_code\":\"dhl\",\"destination\":\"US\",\"original\":\"CN\"},{\"carrier_code\":\"dhl\",\"destination\":\"RU\",\"original\":\"CN\"}]";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"costtime");
    
    Nog Tracking object bijwerken
    String	urlStr =null;
    String requestData="[{\"tracking_number\":\"RM131516216CN\",\"carrier_code\":\"china-post\",\"title\": \"testtitle\",\"customer_name\":\"javatest\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123\",\"logistics_channel\":\"chase chen\",\"destination_code\":\"US\",\"status\":\"7\"},{\"tracking_number\":\"RM111516216CN\",\"carrier_code\":\"china-post\",\"title\": \"testtitle\",\"customer_name\":\"javatest\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123\",\"logistics_channel\":\"chase chen\",\"destination_code\":\"US\",\"status\":\"7\"}]";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"updatemore");
    

Transformeer uw
Zending vandaag nog volgen

Wilt u verzendupdates automatiseren of uw bezorgefficiëntie verbeteren? Met de krachtige API van TrackingMore heb je alle tools binnen handbereik om het traject van je klant na de aankoop te transformeren.