The ETrackings API for Ruby makes it easy to develop using ETrackings API
See the official API documentation for more information
Add this line to your application's Gemfile:
gem 'etrackings'
And then execute:
bundle install
Or install it yourself as:
gem install etrackings
Usage:
# example.rb
class Example
def client
@client ||= Etrackings::Client.new do |config|
config.api_key = ENV["etrackings_api_key"]
config.key_secret = ENV["etrackings_key_secret"]
config.language = ENV["etrackings_language"] || 'TH'
end
end
def track_by_courier(courier = "dhl-express", tracking_no = "THBCA12652305942")
# courier ให้ใส่ชื่อขนส่งที่ระบบรองรับ
client.track(courier, tracking_no)
# ดูเพิ่มเติม https://apps.etrackings.com/docs/trackings
end
def track_kerry_express(tracking_no = "THBCA12652305942")
# สามารถ เรียกชื่อขนส่งได้เลย
client.kerry_express(tracking_no)
# ดูเพิ่มเติม https://apps.etrackings.com/docs/trackings
end
end