Dead-simple Ruby API client for Trackplus. No extra runtime dependencies.
Uses v1 API provided by Trackplus.
Add this line to your application's Gemfile:
gem 'trackplus', git: 'https://github.com/ammit/trackplus-ruby'
And then execute:
$ bundle
Gem covers all traclings & available couriers api
client = Trackplus::Client.new(api_key: 'api_key')
# get supported couriers
client.couriers
# get tracking
client.tracking(courier: 'airwings', tracking_no: '202315836553')
# Possible errors (each one inherits from Trackplus::Errors::TrackplusError)
Trackplus::Errors::InvalidConfiguration # missing api_key / subdomain
Trackplus::Errors::NotAuthorized # wrong api key
Trackplus::Errors::InvalidResponse # something went wrong during the request?
Trackplus::Errors::NotFound # 404 from Trackplus
Trackplus::Errors::RequestToLong # When the requested result takes to long to calculate, try limiting your query
- Fork it ( https://github.com/ammit/trackplus-ruby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request