1.0.0 • Published 5 years ago

samsara_api v1.0.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
5 years ago

samsara_api

SamsaraApi - JavaScript client for samsara_api This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build date: 2016-08-19T10:15:23.341-07:00
  • Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install samsara_api --save

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Getting Started

Please follow the installation instruction and execute the following JS code:

var SamsaraApi = require('samsara_api');

var api = new SamsaraApi.DefaultApi()

var accessToken = "accessToken_example"; // {String} 

var addressParam = new SamsaraApi.AddressParam(); // {AddressParam} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.addFleetAddress(accessToken, addressParam, callback);

Documentation for API Endpoints

All URIs are relative to https://api.samsara.com/v1

ClassMethodHTTP requestDescription
SamsaraApi.DefaultApiaddFleetAddressPOST /fleet/add_addressAdd an address book entry for the group.
SamsaraApi.DefaultApigetFleetPOST /fleet/listGet the vehicles for the group.
SamsaraApi.DefaultApigetFleetLocationsPOST /fleet/locationsGet the GPS locations for all vehicles in the group.
SamsaraApi.DefaultApigetFleetTripsPOST /fleet/tripsGet the trips for the specified vehicle.
SamsaraApi.DefaultApigetSensorsPOST /sensors/listGet the sensors for a group.
SamsaraApi.DefaultApigetSensorsHistoryPOST /sensors/historyGet the historical data for the sensors.
SamsaraApi.DefaultApigetSensorsHumidityPOST /sensors/humidityGet the current humidity readings for the specified sensors.
SamsaraApi.DefaultApigetSensorsTemperaturePOST /sensors/temperatureGet the current temperature readings for the specified sensors.
SamsaraApi.DefaultApiupdateVehiclesPOST /fleet/set_dataUpdate the metadata for a vehicle.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.