TrackingMore API

Python Class Example 

  • 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.


    列出所有運營商
    urlStr = ""
    requestData = ""
    result = tracker.trackingmore(requestData, urlStr, "carriers")
    
    Detect a carrier by tracking code
    urlStr = ""
    requestData = "{\"tracking_number\":\"EA152563251CN\"}"
    result = tracker.trackingmore(requestData, urlStr, "carriers/detect")
    
    創建壹個跟蹤項目
    urlStr = ''
    requestData ="{\"tracking_number\": \"BYS006086075\",\"carrier_code\":\"yanwen\"}"
    result = tracker.trackingmore(requestData, urlStr, "post")
    
    獲取跟蹤單個跟蹤結果。
    urlStr = "/yanwen/BYS006086089"
    requestData =''
    result = tracker.trackingmore(requestData, urlStr, "codeNumberGet")
    
    獲取單次跟蹤的實時跟蹤結果
    urlStr =''
    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\"}"
    result = tracker.trackingmore(requestData, urlStr, "realtime")
    
    創建多個跟蹤。
    urlStr = ''
    requestData ="[{\"tracking_number\": \"EA152565241CN\",\"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\": \"EA152563242CN\",\"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\"}]""
    result = tracker.trackingmore(requestData, urlStr, "batch")
    
    列出所有的跟蹤
    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=EA152563254CN,UG586285221CN&orders=#123&lang=en"
    requestData =''
    result = tracker.trackingmore(requestData, urlStr, "get")
    
    更新跟蹤專案
    urlStr = "/yanwen/BYS006086092"
    requestData ="{\"title\": \"testtitle\",\"customer_name\":\"python test\",\"customer_email\":\"[email protected]\",\"order_id\":\"#1234567\",\"logistics_channel\":\"chase chen python\",\"customer_phone\":\"+86 13873399982\",\"destination_code\":\"US\",\"status\":\"7\"}"
    result = tracker.trackingmore(requestData, urlStr, "codeNumberPut")
    
    刪除跟蹤專案
    urlStr = "/wishpost/82196271478"
    requestData =''
    result = tracker.trackingmore(requestData, urlStr, "codeNumberDelete")
    
    刪除多個跟蹤專案
    urlStr = ""
    requestData = "[{\"tracking_number\":\"EA152563242CN\",\"carrier_code\":\"china-ems\"},{\"tracking_number\":\"EA152563254CN\",\"carrier_code\":\"china-ems\"}]"
    result = tracker.trackingmore(requestData, urlStr, "delete")
    
    修改運輸商簡碼
    urlStr = ""
    requestData = "{\"tracking_number\": \"EA152563242CN\",\"carrier_code\":\"dhl\",\"update_carrier_code\":\"china-ems\"}"
    result = tracker.trackingmore(requestData, urlStr, "update")
    
    查詢用戶剩餘額度
    urlStr = ""
    requestData = ""
    result = tracker.trackingmore(requestData, urlStr, "getuserinfo")
    
    獲取狀態數量
    urlStr = ""
    requestData = ""
    result = tracker.trackingmore(requestData, urlStr, "getstatusnumber")
    
    批量不更新跟蹤項目
    urlStr = ""
    requestData = "[{\"tracking_number\":\"LK032051658CN\",\"carrier_code\":\"china-ems\"},{\"tracking_number\":\"EA166023092CN\",\"carrier_code\":\"china-ems\"}]"
    result = tracker.trackingmore(requestData, urlStr, "notupdate")
    
    檢查裝運是否發送到遠端區域。
    urlStr = ""
    requestData = "[{\"country\":\"CN\",\"postcode\":\"400422\"},{\"country\":\"CN\",\"postcode\":\"412000\"}]"
    result = tracker.trackingmore(requestData, urlStr, "remote")
    
    獲取快遞時效結果
    urlStr = ""
    requestData = "[{\"carrier_code\":\"dhl\",\"destination\":\"US\",\"original\":\"CN\"},{\"carrier_code\":\"dhl\",\"destination\":\"RU\",\"original\":\"CN\"}]"
    result = tracker.trackingmore(requestData, urlStr, "costtime")
    
    更新更多的跟蹤專案
    urlStr = ""
    requestData = "[{\"tracking_number\":\"RM131516216CN\",\"carrier_code\":\"china-post\",\"title\": \"testtitle\",\"customer_name\":\"python test\",\"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\":\"python test\",\"customer_email\":\"[email protected]\",\"order_id\":\"#123\",\"logistics_channel\":\"chase chen\",\"destination_code\":\"US\",\"status\":\"7\"}]"
    result = tracker.trackingmore(requestData, urlStr, "updatemore")
    

轉變您的
今天的貨件追蹤

想要自動更新貨件或提高交付效率?借助 TrackingMore 強大的 API,您將擁有觸手可及的所有工具,以改變客戶的售後旅程。