TrackingMore API

Golang Example 

  • The class of api
    //www.trackingmore.com/api-class_golang.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
    var url string ="http://api.trackingmore.com/v2/trackings/get?page=1&limit=25&created_at_min=1441314361&created_at_max=1477721625"
    httpDo(url,"","GET")
    
    Create a tracking item
    var url string ="http://api.trackingmore.com/v2/trackings/post"
    var postData string ="{\"tracking_number\":\"EA152563251CN\",\"carrier_code\" : \"china-ems\"}"
    httpDo(url,postData,"POST")
    
    Create multiple trackings.
    var url string ="http://api.trackingmore.com/v2/trackings/batch"
    var postData string ="[{\"tracking_number\":\"LM088827160CN\",\"carrier_code\" : \"china-ems\"},{\"tracking_number\":\"LM088827743CN\",\"carrier_code\" : \"china-ems\"}]"
    httpDo(url,postData,"POST")
    
    Get tracking results of a single tracking.
    var url string ="http://api.trackingmore.com/v2/trackings/4px/S000002431442"
    httpDo(url,"","GET")
    
    Update Tracking item
    var url string ="http://api.trackingmore.com/v2/trackings/4px/S000002431442"
    var postData string ="{\"title\":\"new title\",\"customer_name\" : \"sandy\",\"customer_email\" : \"[email protected]\",\"order_id\" : \"#123456\"}"
    httpDo(url,postData,"PUT")
    
    Delete a tracking item
    var url string ="http://api.trackingmore.com/v2/trackings/4px/S000002431442"
    httpDo(url,"","DELETE")
    
    Get realtime tracking results of a single tracking
    var url string ="http://api.trackingmore.com/v2/trackings/realtime"
    var postData string ="{\"tracking_number\":\"S000002858641\",\"carrier_code\" : \"4px\"}"
    httpDo(url,postData,"POST")