TTTelematics
A simple ruby API Wrapper for TomTomTelematics
1. Quick start
Install via Rubygems
gem install tttelematics... or add to Gemfile
gem 'tttelematics'use in IRB
require 'tttelematics'
2. Initialize Client
client = TTTelematics::API::Client.new('apikey','username','account','password')3. Get Objects
For more options Resources Objects TomTomTelematics.
3.1 showObjectReportExtern
#format = ['json','csv']
#client.asset.objects(options, format)
client.asset({objectno: 'OBJECTID'}, 'json')
or
asset = client.asset
objects = asset.objects({}, 'json')
asset = TTTelematics::API::Asset.new(client)
objects = asset({objectno: 'OBJECTID'}, 'json') #response a json
array_objects = JSON.parse(objects)4. Errors
# Common Errors
TTTelematics::Err::InvalidAPIKey -> API key is invalid
TTTelematics::Err::InvalidUser -> User does not exist
TTTelematics::Err::InvalidAction -> Action is not valid