/** * Samsara API * # Overview Something new! Welcome Samsara\'s new and improved API. Check out our FAQ [here](https://developers.samsara.com/docs/introducing-our-next-generation-api) to see what\'s changed and learn how to get started.

Want to access the legacy API docs? You can find them [here](https://www.samsara.com/api-legacy).

*Note: Because this is a new set of APIs, we have not transitioned all endpoints over to this standard. Endpoints that still use the legacy standards are indicated in the reference documentation. If you can\'t find an API that you\'re looking for, we encourage you to look for it in our [legacy API docs](https://www.samsara.com/api-legacy) as we continue to transition all endpoints over. Check back here for updates!*

Submit your feedback [here](https://forms.gle/r4bs6HQshQAvBuwv6)!
Samsara provides API endpoints so that you can build powerful applications and custom solutions with sensor data. Samsara has endpoints available to track and analyze sensors, vehicles, and entire fleets. The Samsara API is a [RESTful API](https://en.wikipedia.org/wiki/Representational_state_transfer). It uses standard [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) authentication, verbs, and response codes, and it returns [JSON](http://www.json.org/) response bodies. If you\'re familiar with what you can build with a REST API, then this will be your go-to API reference. Visit [developers.samsara.com](https://developers.samsara.com) to find getting started guides and an API overview. If you have any questions, please visit https://samsara.com/help. ## Endpoints All our APIs can be accessed through HTTP requests to URLs like: ``` https://api.samsara.com/ ``` For EU customers, this URL will be: ``` https://api.eu.samsara.com/ ``` Note Legacy endpoints will have the URL: `https://api.samsara.com/v1/` or `https://api.eu.samsara.com/v1/` ## Authentication To authenticate your API request you will need to include your secret token. You can manage your API tokens in the [Dashboard](https://cloud.samsara.com). They are visible under `Settings->Organization->API Tokens`. Your API tokens carry many privileges, so be sure to keep them secure. Do not share your secret API tokens in publicly accessible areas such as GitHub, client-side code, and so on. Authentication to the API is performed via Bearer Token in the HTTP Authorization header. Provide your API token as the `access_token` value in an `Authorization: Bearer` header. You do not need to provide a password: ```curl Authorization: Bearer {access_token} ``` All API requests must be made over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP or without authentication will fail. ### OAuth2 If building an application for our marketplace, our API is accessible via. OAuth2 as well. | Type | Value | | ------------- |:-------------:| | Security scheme | OAuth2 | | OAuth2 Flow | accessCode | | Authorization URL | https://api.samsara.com/oauth2/authorize | | Token URL | https://api.samsara.com/oauth2/token | ## Common Patterns You can find more info about request methods, response codes, error codes, versioning, pagination, timestamps, and mini-objects [here](https://developers.samsara.com/docs/common-structures). * * The version of the OpenAPI document: 2024-11-18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /** * * @export * @interface V1DispatchRouteBase */ export interface V1DispatchRouteBase { /** * The time in Unix epoch milliseconds that the route actually ended. * @type {number} * @memberof V1DispatchRouteBase */ 'actual_end_ms'?: number; /** * The time in Unix epoch milliseconds that the route actually started. * @type {number} * @memberof V1DispatchRouteBase */ 'actual_start_ms'?: number; /** * When set to true (default), this causes the Route to complete on arrival at the final stop. When set to false, the last stop will capture arrival and departure separately as with other stops. * @type {boolean} * @memberof V1DispatchRouteBase */ 'complete_last_stop_on_arrival'?: boolean; /** * ID of the driver assigned to the dispatch route. Note that driver_id and vehicle_id are mutually exclusive. If neither is specified, then the route is unassigned. * @type {number} * @memberof V1DispatchRouteBase */ 'driver_id'?: number; /** * The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object. * @type {object} * @memberof V1DispatchRouteBase */ 'externalIds'?: object; /** * Deprecated. * @type {number} * @memberof V1DispatchRouteBase */ 'group_id'?: number; /** * Descriptive name of this route. * @type {string} * @memberof V1DispatchRouteBase */ 'name'?: string; /** * Notes regarding the details of this route; maximum of 2000 characters; newline characters (\'\\n\')can be used for formatting. * @type {string} * @memberof V1DispatchRouteBase */ 'notes'?: string; /** * Odometer reading at the end of the route. Will not be returned if Route is not completed or if Odometer information is not available for the relevant vehicle. * @type {number} * @memberof V1DispatchRouteBase */ 'odometer_end_meters'?: number; /** * Odometer reading at the start of the route. Will not be returned if Route has not started or if Odometer information is not available for the relevant vehicle. * @type {number} * @memberof V1DispatchRouteBase */ 'odometer_start_meters'?: number; /** * The time in Unix epoch milliseconds that the last job in the route is scheduled to end. * @type {number} * @memberof V1DispatchRouteBase */ 'scheduled_end_ms'?: number; /** * The distance expected to be traveled for this route in meters. * @type {number} * @memberof V1DispatchRouteBase */ 'scheduled_meters'?: number; /** * The time in Unix epoch milliseconds that the route is scheduled to start. * @type {number} * @memberof V1DispatchRouteBase */ 'scheduled_start_ms'?: number; /** * The address of the route\'s starting location, as it would be recognized if provided to maps.google.com. Optional if a valid start location address ID is provided. * @type {string} * @memberof V1DispatchRouteBase */ 'start_location_address'?: string; /** * ID of the start location associated with an address book entry. Optional if valid values are provided for start location address and latitude/longitude. If a valid start location address ID is provided, address/latitude/longitude will be used from the address book entry. Name of the address book entry will only be used if the start location name is not provided. * @type {number} * @memberof V1DispatchRouteBase */ 'start_location_address_id'?: number; /** * Latitude of the start location in decimal degrees. Optional if a valid start location address ID is provided. * @type {number} * @memberof V1DispatchRouteBase */ 'start_location_lat'?: number; /** * Longitude of the start location in decimal degrees. Optional if a valid start location address ID is provided. * @type {number} * @memberof V1DispatchRouteBase */ 'start_location_lng'?: number; /** * The name of the route\'s starting location. If provided, it will take precedence over the name of the address book entry. * @type {string} * @memberof V1DispatchRouteBase */ 'start_location_name'?: string; /** * ID of the trailer assigned to the dispatch route. Note that trailers can only be assigned to routes that have a Vehicle or Driver assigned to them. * @type {number} * @memberof V1DispatchRouteBase */ 'trailer_id'?: number; /** * ID of the vehicle assigned to the dispatch route. Note that vehicle_id and driver_id are mutually exclusive. If neither is specified, then the route is unassigned. * @type {number} * @memberof V1DispatchRouteBase */ 'vehicle_id'?: number; }