Javascript SDK for the Samsara REST API.
For Node.js
To install directly from Github:
npm install samsarahq/samsara-js --save
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.
-
Install samsara-js: installation procedure.
-
Get your Samsara API token.
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.
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 |
- SamsaraApi.AddressParam
- SamsaraApi.CreateDispatchJobsParam
- SamsaraApi.DispatchJobsResponse
- SamsaraApi.DispatchJobsResponseDispatchJobs
- SamsaraApi.DriversRespose
- SamsaraApi.DriversResposeDrivers
- SamsaraApi.DriversSummaryParam
- SamsaraApi.DriversSummaryResponse
- SamsaraApi.DriversSummaryResponseSummaries
- SamsaraApi.ErrorResponse
- SamsaraApi.FleetdispatchJobscreateDispatchJobs
- SamsaraApi.FleetdispatchJobsupdateDispatchJobs
- SamsaraApi.GetDispatchJobsParam
- SamsaraApi.GroupDriversParam
- SamsaraApi.GroupParam
- SamsaraApi.HistoryParam
- SamsaraApi.HosAuthenticationLogsParam
- SamsaraApi.HosAuthenticationLogsResponse
- SamsaraApi.HosAuthenticationLogsResponseAuthenticationLogs
- SamsaraApi.HosLogsParam
- SamsaraApi.HosLogsResponse
- SamsaraApi.HosLogsResponseLogs
- SamsaraApi.HumidityResponse
- SamsaraApi.HumidityResponseSensors
- SamsaraApi.InlineResponse200
- SamsaraApi.InlineResponse2001
- SamsaraApi.InlineResponse2002
- SamsaraApi.InlineResponse2003
- SamsaraApi.Sensor
- SamsaraApi.SensorHistoryResponse
- SamsaraApi.SensorHistoryResponseResults
- SamsaraApi.SensorParam
- SamsaraApi.SensorshistorySeries
- SamsaraApi.TemperatureResponse
- SamsaraApi.TemperatureResponseSensors
- SamsaraApi.TripResponse
- SamsaraApi.TripResponseEndCoordinates
- SamsaraApi.TripResponseStartCoordinates
- SamsaraApi.TripResponseTrips
- SamsaraApi.TripsParam
- SamsaraApi.UpdateDispatchJobsParam
- SamsaraApi.Vehicle
- SamsaraApi.VehicleLocation
- SamsaraApi.VehicleMaintenance
- SamsaraApi.VehicleMaintenanceJ1939
- SamsaraApi.VehicleMaintenanceJ1939CheckEngineLight
- SamsaraApi.VehicleMaintenanceJ1939DiagnosticTroubleCodes
- SamsaraApi.VehicleMaintenancePassenger
- SamsaraApi.VehicleMaintenancePassengerCheckEngineLight
- SamsaraApi.VehicleMaintenancePassengerDiagnosticTroubleCodes
- SamsaraApi.VehicleUpdateParam
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