Skip to content

samsarahq/samsara-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

samsara-js

Javascript SDK for the Samsara REST API.

Installation

npm

To install directly from Github:

    npm install samsarahq/samsara-js --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

The access token authenticates requests. It is tied to your organization and can be found on the API Tokens tab on your Organization Settings page in Samsara Cloud (click on the user drop-down in the upper-right of the Dashboard).

All API calls require the access token.

  • Get the Group IDs for the groups you want to access.

The API Tokens tab lists all your organization's Groups and their associated IDs ("groupId").

Certain API calls require this value.

  • Check out the examples in the examples/ directory to see how to use the Javascript client.

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 /fleet/add_address
SamsaraApi.DefaultApi createFleetDispatchJobs POST /fleet/dispatch_jobs/create /fleet/dispatch_jobs/create
SamsaraApi.DefaultApi getFleet POST /fleet/list /fleet/list
SamsaraApi.DefaultApi getFleetDispatchJobs POST /fleet/dispatch_jobs /fleet/dispatch_jobs
SamsaraApi.DefaultApi getFleetDrivers POST /fleet/drivers /fleet/drivers
SamsaraApi.DefaultApi getFleetDriversSummary POST /fleet/drivers/summary /fleet/drivers/summary
SamsaraApi.DefaultApi getFleetHosAuthenticationLogs POST /fleet/hos_authentication_logs /fleet/hos_authentication_logs
SamsaraApi.DefaultApi getFleetHosLogs POST /fleet/hos_logs /fleet/hos_logs
SamsaraApi.DefaultApi getFleetLocations POST /fleet/locations /fleet/locations
SamsaraApi.DefaultApi getFleetMaintenanceList POST /fleet/maintenance/list /fleet/maintenance/list
SamsaraApi.DefaultApi getFleetTrips POST /fleet/trips /fleet/trips
SamsaraApi.DefaultApi getSensors POST /sensors/list /sensors/list
SamsaraApi.DefaultApi getSensorsHistory POST /sensors/history /sensors/history
SamsaraApi.DefaultApi getSensorsHumidity POST /sensors/humidity /sensors/humidity
SamsaraApi.DefaultApi getSensorsTemperature POST /sensors/temperature /sensors/temperature
SamsaraApi.DefaultApi updateFleetDispatchJobs POST /fleet/dispatch_jobs/update /fleet/dispatch_jobs/update
SamsaraApi.DefaultApi updateVehicles POST /fleet/set_data /fleet/set_data
SamsaraApi.FleetApi addFleetAddress POST /fleet/add_address /fleet/add_address
SamsaraApi.FleetApi createFleetDispatchJobs POST /fleet/dispatch_jobs/create /fleet/dispatch_jobs/create
SamsaraApi.FleetApi getFleet POST /fleet/list /fleet/list
SamsaraApi.FleetApi getFleetDispatchJobs POST /fleet/dispatch_jobs /fleet/dispatch_jobs
SamsaraApi.FleetApi getFleetDrivers POST /fleet/drivers /fleet/drivers
SamsaraApi.FleetApi getFleetDriversSummary POST /fleet/drivers/summary /fleet/drivers/summary
SamsaraApi.FleetApi getFleetHosAuthenticationLogs POST /fleet/hos_authentication_logs /fleet/hos_authentication_logs
SamsaraApi.FleetApi getFleetHosLogs POST /fleet/hos_logs /fleet/hos_logs
SamsaraApi.FleetApi getFleetLocations POST /fleet/locations /fleet/locations
SamsaraApi.FleetApi getFleetMaintenanceList POST /fleet/maintenance/list /fleet/maintenance/list
SamsaraApi.FleetApi getFleetTrips POST /fleet/trips /fleet/trips
SamsaraApi.FleetApi updateFleetDispatchJobs POST /fleet/dispatch_jobs/update /fleet/dispatch_jobs/update
SamsaraApi.FleetApi updateVehicles POST /fleet/set_data /fleet/set_data
SamsaraApi.SensorsApi getSensors POST /sensors/list /sensors/list
SamsaraApi.SensorsApi getSensorsHistory POST /sensors/history /sensors/history
SamsaraApi.SensorsApi getSensorsHumidity POST /sensors/humidity /sensors/humidity
SamsaraApi.SensorsApi getSensorsTemperature POST /sensors/temperature /sensors/temperature

Documentation for Models

Footnotes

This Javascript 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

About

Javascript SDK for the Samsara REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published