TrackingMore API

Java Class Example 

  • The class of api
    //www.trackingmore.com/api-class_java.html

        Installation:
            1. Download this Class to desired location
            2. Fill in Trackingmore-Api-Key in this Class in line "protected $apiKey = 'YOUR API KEY';"
            3. Require this class in your project.


    List all trackings
    String urlStr ="?page=1&limit=25&created_at_min=1441314361&created_at_max=1477118489";
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"get");
    
    Create a tracking item
    String urlStr =null;
    String requestData= "{\"tracking_number\": \"EA152563251CN\",\"carrier_code\":\"china-ems\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"post");
    
    Create multiple trackings.
    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,"batch");
    
    Get tracking results of a single tracking.
    String urlStr ="/china-ems/EA166023092CN";
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"codeNumberGet");
    
    Update Tracking item
    String urlStr ="/china-ems/EA166023092CN";
    String requestData="{\"title\": \"testtitle\",\"customer_name\":\"javatest\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123456\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"codeNumberPut");
    
    Delete a tracking item
    String urlStr ="/china-ems/EA166023092CN";
    String requestData=null;
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"codeNumberDelete");
    
    Get realtime tracking results of a single tracking
    String	urlStr =null;
    String requestData="{\"tracking_number\": \"LW505109082CN\",\"carrier_code\":\"china-ems\",\"destination_code\":\"United States\",\"tracking_ship_date\": \"deutsch-post\",\"tracking_postal_code\":\"postnl-3s\",\"specialNumberDestination\":\"postnl-3s\",\"order\":\"#123123\"}";
    String result = new Tracker().orderOnlineByJson(requestData,urlStr,"realtime");
    
  • Facebook Twitter Android App Store
  • ©2014-2017 TrackingMore.All Rights Reserved.