Automatic API Node.js module
Used to access the Automatic API.
There is a sample Express app in the root of this repo. Just fire it up and check it out.
The nodeunit tests can be run with Grunt.
callback will be the same callback you would get from using request.
This method will construct the correct URL you should redirect your users to to grant your app authorization.
scopes- array of scopes to grant access to
state- an unguessable random string used to protect against cross-site request forgery attacks
This method will set the code from a valid authorization. Throws an
Error if the states do not match.
codefrom the GET parameter on redirection back from Automatic
state- the same
This method request the OAuth token from Automatic needed for all REST calls.
This method refreshes the OAuth token with the current token.
Returns whether the current token has expired or not.
Returns a single trip specified by
id OR multiple trips based on
per_page values. The
options object must contain:
id- specific trip id
// returns trip with ID = 5automatic;
page- page number (defaults to 1)
per_page- number of trip to return per page (defaults to 100)
// return page 5 with 10 tripsautomatic;