All URIs are relative to https://api.samsara.com/v1
Method | HTTP request | Description |
---|---|---|
addFleetAddress | POST /fleet/add_address | /fleet/add_address |
createFleetDispatchJobs | POST /fleet/dispatch_jobs/create | /fleet/dispatch_jobs/create |
getFleet | POST /fleet/list | /fleet/list |
getFleetDispatchJobs | POST /fleet/dispatch_jobs | /fleet/dispatch_jobs |
getFleetDrivers | POST /fleet/drivers | /fleet/drivers |
getFleetDriversSummary | POST /fleet/drivers/summary | /fleet/drivers/summary |
getFleetHosAuthenticationLogs | POST /fleet/hos_authentication_logs | /fleet/hos_authentication_logs |
getFleetHosLogs | POST /fleet/hos_logs | /fleet/hos_logs |
getFleetLocations | POST /fleet/locations | /fleet/locations |
getFleetMaintenanceList | POST /fleet/maintenance/list | /fleet/maintenance/list |
getFleetTrips | POST /fleet/trips | /fleet/trips |
updateFleetDispatchJobs | POST /fleet/dispatch_jobs/update | /fleet/dispatch_jobs/update |
updateVehicles | POST /fleet/set_data | /fleet/set_data |
addFleetAddress(accessToken, addressParam)
/fleet/add_address
This method adds an address book entry to the specified group.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var addressParam = new SamsaraApi.AddressParam(); // AddressParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.addFleetAddress(accessToken, addressParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
addressParam | AddressParam |
null (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json
DispatchJobsResponse createFleetDispatchJobs(accessToken, createDispatchJobsParam)
/fleet/dispatch_jobs/create
Create dispatch jobs in the specified group.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var createDispatchJobsParam = new SamsaraApi.CreateDispatchJobsParam(); // CreateDispatchJobsParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.createFleetDispatchJobs(accessToken, createDispatchJobsParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
createDispatchJobsParam | CreateDispatchJobsParam |
No authorization required
- Content-Type: application/json
- Accept: application/json
InlineResponse2001 getFleet(accessToken, groupParam)
/fleet/list
Get list of the vehicles. This method returns a list of the vehicles in the Samsara Cloud and information about them.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var groupParam = new SamsaraApi.GroupParam(); // GroupParam | Group ID to query.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleet(accessToken, groupParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
groupParam | GroupParam | Group ID to query. |
No authorization required
- Content-Type: application/json
- Accept: application/json
DispatchJobsResponse getFleetDispatchJobs(accessToken, getDispatchJobsParam)
/fleet/dispatch_jobs
Get the dispatch jobs for the specified group.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var getDispatchJobsParam = new SamsaraApi.GetDispatchJobsParam(); // GetDispatchJobsParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetDispatchJobs(accessToken, getDispatchJobsParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
getDispatchJobsParam | GetDispatchJobsParam |
No authorization required
- Content-Type: application/json
- Accept: application/json
DriversRespose getFleetDrivers(accessToken, groupDriversParam)
/fleet/drivers
Get all the drivers for the specified group.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var groupDriversParam = new SamsaraApi.GroupDriversParam(); // GroupDriversParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetDrivers(accessToken, groupDriversParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
groupDriversParam | GroupDriversParam |
No authorization required
- Content-Type: application/json
- Accept: application/json
DriversSummaryResponse getFleetDriversSummary(accessToken, driversSummaryParam)
/fleet/drivers/summary
Get the distance and time each driver in an organization has driven in a given time period.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var driversSummaryParam = new SamsaraApi.DriversSummaryParam(); // DriversSummaryParam | Org ID and time range to query.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetDriversSummary(accessToken, driversSummaryParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
driversSummaryParam | DriversSummaryParam | Org ID and time range to query. |
No authorization required
- Content-Type: application/json
- Accept: application/json
HosAuthenticationLogsResponse getFleetHosAuthenticationLogs(accessToken, hosAuthenticationLogsParam)
/fleet/hos_authentication_logs
Get the HOS (hours of service) signin and signout logs for the specified driver. Only signout logs include location information.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var hosAuthenticationLogsParam = new SamsaraApi.HosAuthenticationLogsParam(); // HosAuthenticationLogsParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetHosAuthenticationLogs(accessToken, hosAuthenticationLogsParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
hosAuthenticationLogsParam | HosAuthenticationLogsParam |
No authorization required
- Content-Type: application/json
- Accept: application/json
HosLogsResponse getFleetHosLogs(accessToken, hosLogsParam)
/fleet/hos_logs
Get the HOS (hours of service) logs for the specified driver.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var hosLogsParam = new SamsaraApi.HosLogsParam(); // HosLogsParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetHosLogs(accessToken, hosLogsParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
hosLogsParam | HosLogsParam |
No authorization required
- Content-Type: application/json
- Accept: application/json
InlineResponse2002 getFleetLocations(accessToken, groupParam)
/fleet/locations
Get current location of vehicles in a group. This method returns the current location in latitude and longitude of all vehicles in a requested group.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var groupParam = new SamsaraApi.GroupParam(); // GroupParam | Group ID to query.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetLocations(accessToken, groupParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
groupParam | GroupParam | Group ID to query. |
No authorization required
- Content-Type: application/json
- Accept: application/json
InlineResponse2003 getFleetMaintenanceList(accessToken, groupParam)
/fleet/maintenance/list
Get list of the vehicles with any engine faults or check light data.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var groupParam = new SamsaraApi.GroupParam(); // GroupParam | Group ID to query.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetMaintenanceList(accessToken, groupParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
groupParam | GroupParam | Group ID to query. |
No authorization required
- Content-Type: application/json
- Accept: application/json
TripResponse getFleetTrips(accessToken, tripsParam)
/fleet/trips
Get historical trips data for specified vehicle. This method returns a set of historical trips data for the specified vehicle in the specified time range.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var tripsParam = new SamsaraApi.TripsParam(); // TripsParam | Group ID, vehicle ID and time range to query.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getFleetTrips(accessToken, tripsParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
tripsParam | TripsParam | Group ID, vehicle ID and time range to query. |
No authorization required
- Content-Type: application/json
- Accept: application/json
DispatchJobsResponse updateFleetDispatchJobs(accessToken, updateDispatchJobsParam)
/fleet/dispatch_jobs/update
Update dispatch jobs in the specified group.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var updateDispatchJobsParam = new SamsaraApi.UpdateDispatchJobsParam(); // UpdateDispatchJobsParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.updateFleetDispatchJobs(accessToken, updateDispatchJobsParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
updateDispatchJobsParam | UpdateDispatchJobsParam |
No authorization required
- Content-Type: application/json
- Accept: application/json
updateVehicles(accessToken, vehicleUpdateParam)
/fleet/set_data
This method enables the mutation of metadata for vehicles in the Samsara Cloud.
var SamsaraApi = require('samsara_api');
var apiInstance = new SamsaraApi.FleetApi();
var accessToken = "accessToken_example"; // String | Samsara API access token.
var vehicleUpdateParam = new SamsaraApi.VehicleUpdateParam(); // VehicleUpdateParam |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.updateVehicles(accessToken, vehicleUpdateParam, callback);
Name | Type | Description | Notes |
---|---|---|---|
accessToken | String | Samsara API access token. | |
vehicleUpdateParam | VehicleUpdateParam |
null (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json