samsara_api
v1.0.0
Published
ERROR_UNKNOWN
Downloads
11
Readme
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
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- SamsaraApi.DefaultApi | addFleetAddress | POST /fleet/add_address | Add an address book entry for the group. SamsaraApi.DefaultApi | getFleet | POST /fleet/list | Get the vehicles for the group. SamsaraApi.DefaultApi | getFleetLocations | POST /fleet/locations | Get the GPS locations for all vehicles in the group. SamsaraApi.DefaultApi | getFleetTrips | POST /fleet/trips | Get the trips for the specified vehicle. SamsaraApi.DefaultApi | getSensors | POST /sensors/list | Get the sensors for a group. SamsaraApi.DefaultApi | getSensorsHistory | POST /sensors/history | Get the historical data for the sensors. SamsaraApi.DefaultApi | getSensorsHumidity | POST /sensors/humidity | Get the current humidity readings for the specified sensors. SamsaraApi.DefaultApi | getSensorsTemperature | POST /sensors/temperature | Get the current temperature readings for the specified sensors. SamsaraApi.DefaultApi | updateVehicles | POST /fleet/set_data | Update the metadata for a vehicle.
Documentation for Models
- SamsaraApi.AddressParam
- SamsaraApi.ErrorResponse
- SamsaraApi.GroupParam
- SamsaraApi.HistoryParam
- SamsaraApi.HumidityResponse
- SamsaraApi.HumidityResponseSensors
- SamsaraApi.InlineResponse200
- SamsaraApi.InlineResponse2001
- SamsaraApi.InlineResponse2002
- SamsaraApi.Sensor
- SamsaraApi.SensorHistoryResponse
- SamsaraApi.SensorHistoryResponseResults
- SamsaraApi.SensorParam
- SamsaraApi.SensorshistorySeries
- SamsaraApi.TemperatureResponse
- SamsaraApi.TemperatureResponseSensors
- SamsaraApi.TripResponse
- SamsaraApi.TripResponseTrips
- SamsaraApi.TripsParam
- SamsaraApi.Vehicle
- SamsaraApi.VehicleLocation
- SamsaraApi.VehicleUpdateParam
Documentation for Authorization
All endpoints do not require authorization.