Python Class Example 

  • The class of api
    //www.trackingmore.com/api-class_python.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
    urlStr = "?page=1&limit=25&created_at_min=1441314361&created_at_max=1477381535"
    requestData =''
    result = tracker.trackingmore(requestData, urlStr, "get")
    
    Create a tracking item
    urlStr = ''
    requestData ="{\"tracking_number\": \"BYS006086075\",\"carrier_code\":\"yanwen\"}"
    result = tracker.trackingmore(requestData, urlStr, "post")
    
    Create multiple trackings.
    urlStr = ''
    requestData ="[{\"tracking_number\": \"BYS006086089\",\"carrier_code\":\"yanwen\"},{\"tracking_number\": \"BYS006086092\",\"carrier_code\":\"yanwen\"}]"
    result = tracker.trackingmore(requestData, urlStr, "batch")
    
    Get tracking results of a single tracking.
    urlStr = "/yanwen/BYS006086089"
    requestData =''
    result = tracker.trackingmore(requestData, urlStr, "codeNumberGet")
    
    Update Tracking item
    urlStr = "/yanwen/BYS006086092"
    requestData ="{\"title\": \"test\",\"customer_name\":\"abner\",\"customer_email\":\"*********@qq.com\",\"order_id\":\"#123123\"}"
    result = tracker.trackingmore(requestData, urlStr, "codeNumberPut")
    
    Delete a tracking item
    urlStr = "/wishpost/82196271478"
    requestData =''
    result = tracker.trackingmore(requestData, urlStr, "codeNumberDel")
    
    Get realtime tracking results of a single tracking
    urlStr =''
    requestData ="{\"tracking_number\": \"BYS006086061\",\"carrier_code\":\"yanwen\"}"
    result = tracker.trackingmore(requestData, urlStr, "realtime")