Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "schemes": [
- "https"
- ],
- "swagger": "2.0",
- "info": {
- "description": "# Introduction\n\nSamsara provides API endpoints for interacting with Samsara Cloud, 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.\n\nThe Samsara Cloud API is a [RESTful API](https://en.wikipedia.org/wiki/Representational_state_transfer) accessed by an [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) client such as wget or curl, or HTTP libraries of most modern programming languages including python, ruby, java. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We allow you to interact securely with our API from a client-side web application (though you should never expose your secret API key). [JSON](http://www.json.org/) is returned by all API responses, including errors. If you’re familiar with what you can build with a REST API, the following API reference guide will be your go-to resource.\n\nAPI access to the Samsara cloud is available to all Samsara administrators. To start developing with Samsara APIs you will need to [obtain your API keys](#section/Authentication) to authenticate your API requests.\n\nIf you have any questions you can reach out to us on [support@samsara.com](mailto:support@samsara.com)\n\n# Endpoints\n\nAll our APIs can be accessed through HTTP requests to URLs like:\n\n```curl\nhttps://api.samsara.com/\u003cversion\u003e/\u003cendpoint\u003e\n```\n\nAll our APIs are [versioned](#section/Versioning). If we intend to make breaking changes to an API which either changes the response format or request parameter, we will increment the version.\n\n# Authentication\n\nTo 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-\u003eOrganization-\u003eAPI Tokens`.\n\nYour 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.\n\nAuthentication to the API is performed via [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Provide your API token as the basic access_token value in the URL. You do not need to provide a password.\n\n```curl\nhttps://api.samsara.com/\u003cversion\u003e/\u003cendpoint\u003e?access_token={access_token}\n```\n\nAll API requests must be made over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP or without authentication will fail.\n\n# Request Methods\n\nOur API endpoints use [HTTP request methods](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) to specify the desired operation to be performed. The documentation below specified request method supported by each endpoint and the resulting action.\n\n## GET\n\nGET requests are typically used for fetching data (like data for a particular driver).\n\n## POST\n\nPOST requests are typically used for creating or updating a record (like adding new tags to the system). With that being said, a few of our POST requests can be used for fetching data (like current location data of your fleet).\n\n## PUT\n\nPUT requests are typically used for updating an existing record (like updating all devices associated with a particular tag).\n\n## PATCH\n\nPATCH requests are typically used for modifying an existing record (like modifying a few devices associated with a particular tag).\n\n## DELETE\n\nDELETE requests are used for deleting a record (like deleting a tag from the system).\n\n# Response Codes\n\nAll API requests will respond with appropriate [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). Your API client should handle each response class differently.\n\n## 2XX\n\nThese are successful responses and indicate that the API request returned the expected response.\n\n## 4XX\n\nThese indicate that there was a problem with the request like a missing parameter or invalid values. Check the response for specific [error details](#section/Error-Responses). Requests that respond with a 4XX status code, should be modified before retrying.\n\n## 5XX\n\nThese indicate server errors when the server is unreachable or is misconfigured. In this case, you should retry the API request after some delay.\n\n# Error Responses\n\nIn case of a 4XX status code, the body of the response will contain information to briefly explain the error reported. To help debugging the error, you can refer to the following table for understanding the error message.\n\n| Status Code | Message | Description |\n|-------------|----------------|-------------------------------------------------------------------|\n| 401 | Invalid token | The API token is invalid and could not be authenticated. Please refer to the [authentication section](#section/Authentication). |\n| 404 | Page not found | The API endpoint being accessed is invalid. |\n| 400 | Bad request | Default response for an invalid request. Please check the request to make sure it follows the format specified in the documentation. |\n\n# Versioning\n\nAll our APIs are versioned. Our current API version is v1 and we are continuously working on improving it further and providing additional endpoints. If we intend to make breaking changes in a backwards-incompatible way, we release a new dated version to your API. Thus, you can use our current API version worry free. For a detailed guide on how to upgrade your API token, please check out this [Knowledge Base article](https://kb.samsara.com/hc/en-us/articles/360026132972-Upgrading-API-Tokens).\n\n# FAQs\n\nCheck out our [responses to FAQs here](https://kb.samsara.com/hc/en-us/sections/360000538054-APIs). Don’t see an answer to your question? Reach out to us on [support@samsara.com](mailto:support@samsara.com).",
- "title": "Samsara API",
- "version": "1.0.0"
- },
- "host": "api.samsara.com",
- "paths": {
- "/v1/addresses": {
- "get": {
- "description": "Fetch all addresses/geofences for the organization. An address contains either a circle or polygon geofence describing the address boundaries.",
- "tags": [
- "Fleet"
- ],
- "summary": "/addresses",
- "operationId": "getOrganizationAddresses",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of addresses/geofences. For each address entry, the geofence field will only be populated with either 'circle' or 'polygon', depending on the geofence type.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Address"
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Add one or more addresses to the organization",
- "tags": [
- "Fleet"
- ],
- "summary": "/addresses",
- "operationId": "addOrganizationAddresses",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/addressAddParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of added addresses/geofences. For each address entry, the geofence field will only be populated with either 'circle' or 'polygon', depending on the geofence type. Circle geofences added without a specific lat/lng are geocoded asynchronously, and will be 0,0 in the immediate response.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Address"
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/addresses/{addressId}": {
- "get": {
- "description": "Fetch an address by its id.",
- "tags": [
- "Fleet"
- ],
- "summary": "/addresses/{addressId}",
- "operationId": "getOrganizationAddress",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the address/geofence",
- "name": "addressId",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "The address/geofence. The geofence field will only be populated with either 'circle' or 'polygon', depending on the geofence type.",
- "schema": {
- "$ref": "#/definitions/Address"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "delete": {
- "description": "Delete an address.",
- "tags": [
- "Fleet"
- ],
- "summary": "/addresses/{addressId}",
- "operationId": "deleteOrganizationAddress",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the address/geofence",
- "name": "addressId",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Address was successfully deleted. No response body is returned."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "patch": {
- "description": "Update the name, formatted address, geofence, notes, or tag and contact Ids for an address. The set of tags or contacts associated with this address will be updated to exactly match the list of IDs passed in. To remove all tags or contacts from an address, pass an empty list; to remove notes, pass an empty string.",
- "tags": [
- "Fleet"
- ],
- "summary": "/addresses/{addressId}",
- "operationId": "updateOrganizationAddress",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/addressUpdateParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the address/geofence",
- "name": "addressId",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Address was successfully updated. No response body is returned."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/contacts": {
- "get": {
- "description": "Fetch all contacts for the organization.",
- "tags": [
- "Contacts"
- ],
- "summary": "/contacts",
- "operationId": "listContacts",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of contacts.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Contact"
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Add a contact to the organization",
- "tags": [
- "Contacts"
- ],
- "summary": "/contacts",
- "operationId": "addOrganizationContact",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/addContactParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Contact was successfully added.",
- "schema": {
- "$ref": "#/definitions/ContactData"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/contacts/{contact_id}": {
- "get": {
- "description": "Fetch a contact by its id.",
- "tags": [
- "Contacts"
- ],
- "summary": "/contacts/{contact_id}",
- "operationId": "getOrganizationContact",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the contact",
- "name": "contact_id",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "The contact.",
- "schema": {
- "$ref": "#/definitions/Contact"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "delete": {
- "description": "Delete a contact.",
- "tags": [
- "Contacts"
- ],
- "summary": "/contacts/{contact_id}",
- "operationId": "deleteOrganizationContact",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the contact",
- "name": "contact_id",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Contact was successfully deleted."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "patch": {
- "description": "Update a contact by its id.",
- "tags": [
- "Contacts"
- ],
- "summary": "/contacts/{contact_id}",
- "operationId": "updateOrganizationContact",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/updateContactParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the contact",
- "name": "contact_id",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Contact was successfully updated.",
- "schema": {
- "$ref": "#/definitions/ContactData"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/add_address": {
- "post": {
- "description": "This method adds an address book entry to the specified group.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/add_address",
- "operationId": "addFleetAddress",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "name": "addressParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "groupId",
- "name",
- "address",
- "radius"
- ],
- "properties": {
- "address": {
- "description": "The address of the entry to add, as it would be recognized if provided to maps.google.com.",
- "type": "string",
- "example": "501 York St"
- },
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "name": {
- "description": "Name of the location to add to the address book.",
- "type": "string",
- "example": "HQ"
- },
- "radius": {
- "description": "Radius in meters of the address (used for matching vehicle trip stops to this location).",
- "type": "integer",
- "example": 10
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Address was successfully added. No response body is returned."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/assets": {
- "get": {
- "description": "Fetch all of the assets for the group.",
- "tags": [
- "Fleet",
- "Assets"
- ],
- "summary": "/fleet/assets",
- "operationId": "getAllAssets",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of assets.",
- "schema": {
- "type": "object",
- "properties": {
- "assets": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Asset"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/assets/locations": {
- "get": {
- "description": "Fetch current locations of all assets for the group.",
- "tags": [
- "Fleet",
- "Assets"
- ],
- "summary": "/fleet/assets/locations",
- "operationId": "getAllAssetCurrentLocations",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of assets and their current locations.",
- "schema": {
- "type": "object",
- "properties": {
- "assets": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/AssetCurrentLocationsResponse"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/assets/{asset_id}/locations": {
- "get": {
- "description": "Fetch the historical locations for the asset.",
- "tags": [
- "Fleet",
- "Assets"
- ],
- "summary": "/fleet/assets/{assetId}/locations",
- "operationId": "getAssetLocation",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/assetIdParam"
- },
- {
- "$ref": "#/parameters/assetHistoryStartTimeParam"
- },
- {
- "$ref": "#/parameters/assetHistoryEndTimeParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Asset location details.",
- "schema": {
- "$ref": "#/definitions/AssetLocationResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/assets/{asset_id}/reefer": {
- "get": {
- "description": "Fetch the reefer-specific stats of an asset.",
- "tags": [
- "Fleet",
- "Assets"
- ],
- "summary": "/fleet/assets/{assetId}/reefer",
- "operationId": "getAssetReefer",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/assetIdParam"
- },
- {
- "$ref": "#/parameters/assetHistoryStartTimeParam"
- },
- {
- "$ref": "#/parameters/assetHistoryEndTimeParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Reefer-specific asset details.",
- "schema": {
- "$ref": "#/definitions/AssetReeferResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/dispatch/routes": {
- "get": {
- "description": "Fetch all of the dispatch routes for the group.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes",
- "operationId": "fetchAllDispatchRoutes",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdParam"
- },
- {
- "$ref": "#/parameters/routeEndTimeParam"
- },
- {
- "$ref": "#/parameters/routeDurationParam"
- }
- ],
- "responses": {
- "200": {
- "description": "All dispatch route objects for the group.",
- "schema": {
- "$ref": "#/definitions/DispatchRoutes"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Create a new dispatch route.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes",
- "operationId": "createDispatchRoute",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/routeCreateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Created route object including the new route ID.",
- "schema": {
- "$ref": "#/definitions/DispatchRoute"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/dispatch/routes/job_updates": {
- "get": {
- "description": "Fetch all updates to a job including route data in the last 24 hours or subsequent to an sequence ID. Returns a maximum of 500 job updates. If more than 500 job updates are available, another request made with the prior request's sequence_id will return the next set of available job updates.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes/job_updates",
- "operationId": "fetchAllRouteJobUpdates",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdParam"
- },
- {
- "$ref": "#/parameters/lastReceivedSequenceIDParam"
- },
- {
- "$ref": "#/parameters/jobUpdatesIncludeParam"
- }
- ],
- "responses": {
- "200": {
- "description": "All job updates on routes.",
- "schema": {
- "$ref": "#/definitions/allRouteJobUpdates"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/dispatch/routes/{route_id}": {
- "get": {
- "description": "Fetch a dispatch route by id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes/{route_id}",
- "operationId": "getDispatchRouteById",
- "responses": {
- "200": {
- "description": "The dispatch route corresponding to route_id.",
- "schema": {
- "$ref": "#/definitions/DispatchRoute"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "put": {
- "description": "Update a dispatch route and its associated jobs.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes/{route_id}/",
- "operationId": "updateDispatchRouteById",
- "parameters": [
- {
- "$ref": "#/parameters/routeUpdateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Update the dispatch route. Allowable updates include setting job state, adding or removing jobs, and changing job locations and times.",
- "schema": {
- "$ref": "#/definitions/DispatchRoute"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "delete": {
- "description": "Delete a dispatch route and its associated jobs.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes/{route_id}/",
- "operationId": "deleteDispatchRouteById",
- "responses": {
- "200": {
- "description": "Successfully deleted the dispatch route. No response body is returned."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the dispatch route. Must contain only digits 0-9.",
- "name": "route_id",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/dispatch/routes/{route_id}/history": {
- "get": {
- "description": "Fetch the history of a dispatch route.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/dispatch/routes/{route_id}/history",
- "operationId": "getDispatchRouteHistory",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/routeHistoryStartTimeParam"
- },
- {
- "$ref": "#/parameters/routeHistoryEndTimeParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the route with history. Must contain only digits 0-9.",
- "name": "route_id",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "The historical route state changes between start_time and end_time.",
- "schema": {
- "$ref": "#/definitions/DispatchRouteHistory"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers": {
- "get": {
- "description": "Get all the drivers for the specified group.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers",
- "operationId": "getFleetDrivers",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "All drivers in the group.",
- "schema": {
- "$ref": "#/definitions/DriversResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers/create": {
- "post": {
- "description": "Create a new driver.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/create",
- "operationId": "createDriver",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/createDriverParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the successfully created the driver.",
- "schema": {
- "$ref": "#/definitions/Driver"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers/document_types": {
- "get": {
- "description": "Fetch all of the document types.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers/document_types",
- "operationId": "getDriverDocumentTypesByOrgId",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns all of the document types.",
- "schema": {
- "$ref": "#/definitions/DocumentTypes"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers/documents": {
- "get": {
- "description": "Fetch all of the documents.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers/documents",
- "operationId": "getDriverDocumentsByOrgId",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/documentsEndMsParam"
- },
- {
- "$ref": "#/parameters/documentsDurationMsParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns all of the documents.",
- "schema": {
- "$ref": "#/definitions/Documents"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers/inactive": {
- "get": {
- "description": "Fetch all deactivated drivers for the group.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/inactive",
- "operationId": "getAllDeactivatedDrivers",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns an array of all deactivated drivers for the group. Deactivated drivers are referenced at /fleet/drivers/inactive/{driver_id}",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Driver"
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers/inactive/{driver_id_or_external_id}": {
- "get": {
- "description": "Fetch deactivated driver by id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/inactive/{driver_id or external_id}",
- "operationId": "getDeactivatedDriverById",
- "responses": {
- "200": {
- "description": "Returns the deactivated driver with the given driver_id.",
- "schema": {
- "$ref": "#/definitions/Driver"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "put": {
- "description": "Reactivate the inactive driver having id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/inactive/{driver_id or external_id}",
- "operationId": "reactivateDriverById",
- "parameters": [
- {
- "$ref": "#/parameters/reactivateDriverParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the reactivated driver, which is now available at /fleet/drivers/{driver_id}.",
- "schema": {
- "$ref": "#/definitions/CurrentDriver"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/driverIdOrExternalIdParam"
- }
- ]
- },
- "/v1/fleet/drivers/summary": {
- "get": {
- "description": "Get the distance and time each driver in an organization has driven in a given time period.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers/summary",
- "operationId": "getFleetDriversSummary",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "boolean",
- "description": "Snap query result to HOS day boundaries.",
- "name": "snap_to_day_bounds",
- "in": "query"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Start time (ms) of queried time period.",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "End time (ms) of queried time period. Must be greater than startMs.",
- "name": "endMs",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Distance traveled and time active for each driver in the organization over the specified time period.",
- "schema": {
- "$ref": "#/definitions/DriversSummaryResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/drivers/{driverId}/safety/score": {
- "get": {
- "description": "Fetch the safety score for the driver.",
- "tags": [
- "Fleet",
- "Safety"
- ],
- "summary": "/fleet/drivers/{driverId}/safety/score",
- "operationId": "getDriverSafetyScore",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/safetyScoreStartMsParam"
- },
- {
- "$ref": "#/parameters/safetyScoreEndMsParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Safety score details.",
- "schema": {
- "$ref": "#/definitions/DriverSafetyScoreResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the driver. Must contain only digits 0-9.",
- "name": "driverId",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/drivers/{driver_id_or_external_id}": {
- "get": {
- "description": "Fetch driver by id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/{driver_id or external_id}",
- "operationId": "getDriverById",
- "responses": {
- "200": {
- "description": "Returns the driver for the given driver_id.",
- "schema": {
- "$ref": "#/definitions/CurrentDriver"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "delete": {
- "description": "Deactivate a driver with the given id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/{driver_id or external_id}",
- "operationId": "deactivateDriver",
- "responses": {
- "200": {
- "description": "Successfully deactivated the driver, which is now referenced by /fleet/drivers/inactive/{driver_id}."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "patch": {
- "description": "Update a driver by id or by external id",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Drivers"
- ],
- "summary": "/fleet/drivers/{driver_id or external_id}",
- "operationId": "updateDriverById",
- "parameters": [
- {
- "$ref": "#/parameters/updateDriverParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the updated driver.",
- "schema": {
- "$ref": "#/definitions/CurrentDriver"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/driverIdOrExternalIdParam"
- }
- ]
- },
- "/v1/fleet/drivers/{driver_id}/dispatch/routes": {
- "get": {
- "description": "Fetch all of the dispatch routes for a given driver.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/drivers/{driver_id}/dispatch/routes",
- "operationId": "getDispatchRoutesByDriverId",
- "parameters": [
- {
- "$ref": "#/parameters/routeEndTimeParam"
- },
- {
- "$ref": "#/parameters/routeDurationParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the dispatch routes for the given driver_id.",
- "schema": {
- "$ref": "#/definitions/DispatchRoutes"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Create a new dispatch route for the driver with driver_id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/drivers/{driver_id}/dispatch/routes",
- "operationId": "createDriverDispatchRoute",
- "parameters": [
- {
- "$ref": "#/parameters/routeCreateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Created route object including the new route ID.",
- "schema": {
- "$ref": "#/definitions/DispatchRoute"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the driver with the associated routes. Must contain only digits 0-9.",
- "name": "driver_id",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/drivers/{driver_id}/documents": {
- "post": {
- "description": "Create a driver document for the given driver.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers/{driver_id}/documents",
- "operationId": "createDriverDocument",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/documentCreateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the created document.",
- "schema": {
- "$ref": "#/definitions/Document"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the driver for whom the document is created. Must contain only digits 0-9.",
- "name": "driver_id",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/drivers/{driver_id}/documents/{document_id}": {
- "get": {
- "description": "Fetches a single document submission by driver.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers/{driver_id}/documents/{document_id}",
- "operationId": "getDriverDocumentByIdAndDriverId",
- "responses": {
- "200": {
- "description": "Returns the specified document.",
- "schema": {
- "$ref": "#/definitions/Document"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the driver who submitted the document. Must contain only digits 0-9.",
- "name": "driver_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "ID of document.",
- "name": "document_id",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/drivers/{driver_id}/hos_daily_logs": {
- "get": {
- "description": "Get summarized daily HOS charts for a specified driver.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/drivers/{driver_id}/hos_daily_logs",
- "operationId": "getFleetDriversHosDailyLogs",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the driver with HOS logs.",
- "name": "driver_id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Beginning of the time range, specified in milliseconds UNIX time.",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "End of the time range, specified in milliseconds UNIX time.",
- "name": "endMs",
- "in": "query",
- "required": true
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Distance traveled and time active for each driver in the organization over the specified time period.",
- "schema": {
- "$ref": "#/definitions/DriverDailyLogResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/hos_authentication_logs": {
- "get": {
- "description": "Get the HOS (hours of service) signin and signout logs for the specified driver. Only signout logs include location information.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/hos_authentication_logs",
- "operationId": "getFleetHosAuthenticationLogs",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Driver ID to query.",
- "name": "driverId",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Beginning of the time range, specified in milliseconds UNIX time.",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "End of the time range, specified in milliseconds UNIX time.",
- "name": "endMs",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "HOS authentication logs for the specified driver.",
- "schema": {
- "$ref": "#/definitions/HosAuthenticationLogsResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/hos_logs": {
- "post": {
- "description": "Get the HOS (hours of service) logs for the specified driver. This method returns all the HOS statuses that the driver was in during this time period.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/hos_logs",
- "operationId": "getFleetHosLogs",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "name": "hosLogsParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "groupId",
- "driverId",
- "startMs",
- "endMs"
- ],
- "properties": {
- "driverId": {
- "description": "Driver ID to query.",
- "type": "integer",
- "format": "int64",
- "example": 444
- },
- "endMs": {
- "description": "End of the time range, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1462881998034
- },
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "startMs": {
- "description": "Beginning of the time range, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1462878398034
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "HOS logs for the specified driver.",
- "schema": {
- "$ref": "#/definitions/HosLogsResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/hos_logs_summary": {
- "get": {
- "description": "Get the current HOS status for all drivers in the group.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/hos_logs_summary",
- "operationId": "getFleetHosLogsSummary",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "HOS logs for the specified driver.",
- "schema": {
- "$ref": "#/definitions/HosLogsSummaryResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/list": {
- "get": {
- "description": "Get list of the vehicles. This method returns a list of the vehicles in the Samsara Cloud and information about them.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/list",
- "operationId": "listFleet",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- },
- {
- "$ref": "#/parameters/paginationStartingAfterParam"
- },
- {
- "$ref": "#/parameters/paginationEndingBeforeParam"
- },
- {
- "$ref": "#/parameters/paginationLimitParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of vehicles and information about each.",
- "schema": {
- "type": "object",
- "properties": {
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "pagination": {
- "$ref": "#/definitions/Pagination"
- },
- "vehicles": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Vehicle"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/locations": {
- "get": {
- "description": "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.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/locations",
- "operationId": "getFleetLocations",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of vehicle objects containing their location and the time at which that location was logged.",
- "schema": {
- "type": "object",
- "properties": {
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "vehicles": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/VehicleLocation"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/maintenance/dvirs": {
- "get": {
- "description": "Get DVIRs for the org within provided time constraints",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/maintenance/dvirs",
- "operationId": "getDvirs",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "description": "time in millis until the last dvir log.",
- "name": "end_ms",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "description": "time in millis which corresponds to the duration before the end_ms.",
- "name": "duration_ms",
- "in": "query",
- "required": true
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "DVIRs for the specified duration.",
- "schema": {
- "$ref": "#/definitions/DvirListResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Create a new dvir, marking a vehicle or trailer safe or unsafe.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/maintenance/dvirs",
- "operationId": "createDvir",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/createDvirParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Newly created DVIR.",
- "schema": {
- "$ref": "#/definitions/DvirBase"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/maintenance/list": {
- "get": {
- "description": "Get list of the vehicles with any engine faults or check light data.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/maintenance/list",
- "operationId": "getFleetMaintenanceList",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of vehicles and maintenance information about each.",
- "schema": {
- "type": "object",
- "properties": {
- "vehicles": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/VehicleMaintenance"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/messages": {
- "get": {
- "description": "Get all messages.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Messages"
- ],
- "summary": "/fleet/messages",
- "operationId": "getMessages",
- "parameters": [
- {
- "$ref": "#/parameters/getMessagesEndMsParam"
- },
- {
- "$ref": "#/parameters/getMessagesDurationMsParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the fetched messages from most recently sent to least recently sent.",
- "schema": {
- "description": "A list of messages.",
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/MessagesResponse"
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Send a message to a list of driver ids.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Messages"
- ],
- "summary": "/fleet/messages",
- "operationId": "createMessages",
- "parameters": [
- {
- "$ref": "#/parameters/createMessagesParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the created messages.",
- "schema": {
- "description": "A list of created messages.",
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/Messages"
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- }
- ]
- },
- "/v1/fleet/set_data": {
- "post": {
- "description": "This API allows you to update metadata for a single vehicle.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/set_data",
- "operationId": "updateVehicles",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "name": "vehicleUpdateParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "vehicles"
- ],
- "properties": {
- "vehicles": {
- "type": "array",
- "items": {
- "description": "A vehicle object.",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "$ref": "#/definitions/Vehicle/properties/id"
- },
- "name": {
- "$ref": "#/definitions/Vehicle/properties/name"
- },
- "note": {
- "$ref": "#/definitions/Vehicle/properties/note"
- }
- }
- }
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Vehicles were successfully updated. No response body is returned."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/trailers/assignments": {
- "get": {
- "description": "Fetch trailer assignment data for all trailers in your organization.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/trailers/assignments",
- "operationId": "getAllTrailerAssignments",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in Unix epoch miliseconds representing the start of the period to fetch. Omitting both startMs and endMs only returns current assignments.",
- "name": "startMs",
- "in": "query"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in Unix epoch miliseconds representing the end of the period to fetch. Omitting endMs sets endMs as the current time",
- "name": "endMs",
- "in": "query"
- },
- {
- "$ref": "#/parameters/paginationLimitParam"
- },
- {
- "$ref": "#/parameters/paginationStartingAfterParam"
- },
- {
- "$ref": "#/parameters/paginationEndingBeforeParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns trailer assignment data for all trailers in your organization",
- "schema": {
- "type": "object",
- "properties": {
- "pagination": {
- "$ref": "#/definitions/Pagination"
- },
- "trailers": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TrailerAssignmentsResponse"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/trailers/{trailerId}/assignments": {
- "get": {
- "description": "Fetch trailer assignment data for a single trailer.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/trailers/{trailerId}/assignments",
- "operationId": "getFleetTrailerAssignments",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of trailer. Must contain only digits 0-9.",
- "name": "trailerId",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in Unix epoch milliseconds representing the start of the period to fetch. Omitting both startMs and endMs only returns current assignments.",
- "name": "startMs",
- "in": "query"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in Unix epoch milliseconds representing the end of the period to fetch. Omitting endMs sets endMs as the current time",
- "name": "endMs",
- "in": "query"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns trailer assignment data for a single trailer",
- "schema": {
- "$ref": "#/definitions/TrailerAssignmentsResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/trips": {
- "get": {
- "description": "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.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/trips",
- "operationId": "getFleetTrips",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Vehicle ID to query.",
- "name": "vehicleId",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "description": "Beginning of the time range, specified in milliseconds UNIX time. Limited to a 90 day window with respect to startMs and endMs",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "description": "End of the time range, specified in milliseconds UNIX time.",
- "name": "endMs",
- "in": "query",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "List of trips taken by the requested vehicle within the specified timeframe.",
- "schema": {
- "$ref": "#/definitions/TripResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/vehicles/locations": {
- "get": {
- "description": "Fetch locations for all vehicles between a start/end time. The maximum query duration is 30 minutes (1800000 ms).",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/vehicles/locations",
- "operationId": "getVehiclesLocations",
- "responses": {
- "200": {
- "description": "Returns locations for all vehicles between a start/end time, with a maximum query duration of 30 minutes (1800000 ms).",
- "schema": {
- "$ref": "#/definitions/FleetVehiclesLocations"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "description": "Time in Unix epoch milliseconds for the start of the query (cannot exceed 30 minutes)",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "description": "Time in Unix epoch milliseconds for the end of the query (cannot exceed 30 minutes)",
- "name": "endMs",
- "in": "query",
- "required": true
- }
- ]
- },
- "/v1/fleet/vehicles/stats": {
- "get": {
- "description": "Fetch engine state and aux input data for all vehicles in the group between a start/end time. This endpoint provides the current state of all vehicles, not just the state changes, during the requested time period. Data returned may be affected by device connectivity and processing time.",
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/vehicles/stats",
- "operationId": "getVehicleStats",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "description": "Time in Unix epoch milliseconds for the start of the query.",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "description": "Time in Unix epoch milliseconds for the end of the query.",
- "name": "endMs",
- "in": "query",
- "required": true
- },
- {
- "enum": [
- "engineState",
- "auxInput1",
- "auxInput2"
- ],
- "type": "string",
- "description": "Comma-separated list of stat types. Options are engineState, auxInput1, and auxInput2. If this parameter is excluded, all 3 stat types will be returned. Example: series=engineState,auxInput2",
- "name": "series",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Comma-separated list of tag ids. Example: tagIds=1,2,3",
- "name": "tagIds",
- "in": "query"
- },
- {
- "$ref": "#/parameters/paginationStartingAfterParam"
- },
- {
- "$ref": "#/parameters/paginationEndingBeforeParam"
- },
- {
- "$ref": "#/parameters/paginationLimitParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns engine state and/or aux input data for all vehicles in the group between a start/end time.",
- "schema": {
- "type": "object",
- "required": [
- "vehicleStats"
- ],
- "properties": {
- "pagination": {
- "$ref": "#/definitions/Pagination"
- },
- "vehicleStats": {
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "vehicleId"
- ],
- "properties": {
- "auxInput1": {
- "$ref": "#/definitions/AuxInputSeries"
- },
- "auxInput2": {
- "$ref": "#/definitions/AuxInputSeries"
- },
- "engineState": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/EngineState"
- }
- },
- "externalIds": {
- "description": "Dictionary of external IDs (string key-value pairs)",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- },
- "example": {
- "maintenanceId": "250020",
- "vehicleNumber": "ABFS18600"
- }
- },
- "vehicleId": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- }
- }
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/vehicles/{vehicleId}/safety/harsh_event": {
- "get": {
- "description": "Fetch harsh event details for a vehicle.",
- "tags": [
- "Fleet",
- "Safety"
- ],
- "summary": "/fleet/vehicles/{vehicleId}/safety/harsh_event",
- "operationId": "getVehicleHarshEvent",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/harshEventMsParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Harsh event details.",
- "schema": {
- "$ref": "#/definitions/VehicleHarshEventResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the vehicle. Must contain only digits 0-9.",
- "name": "vehicleId",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/vehicles/{vehicleId}/safety/score": {
- "get": {
- "description": "Fetch the safety score for the vehicle.",
- "tags": [
- "Fleet",
- "Safety"
- ],
- "summary": "/fleet/vehicles/{vehicleId}/safety/score",
- "operationId": "getVehicleSafetyScore",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/safetyScoreStartMsParam"
- },
- {
- "$ref": "#/parameters/safetyScoreEndMsParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Safety score details.",
- "schema": {
- "$ref": "#/definitions/VehicleSafetyScoreResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the vehicle. Must contain only digits 0-9.",
- "name": "vehicleId",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/vehicles/{vehicle_id_or_external_id}": {
- "get": {
- "description": "Gets a specific vehicle.",
- "consumes": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/vehicles/{vehicle_id or external_id}",
- "operationId": "getFleetVehicle",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/vehicleIdOrExternalIdParam"
- }
- ],
- "responses": {
- "200": {
- "description": "The specified vehicle.",
- "schema": {
- "$ref": "#/definitions/FleetVehicleResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "patch": {
- "description": "Updates the specified vehicle using JSON merge patch format. See IETF RFC 7396: https://tools.ietf.org/html/rfc7396.",
- "consumes": [
- "application/json",
- "application/merge-patch+json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/vehicles/{vehicle_id or external_id}",
- "operationId": "patchFleetVehicle",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/vehicleIdOrExternalIdParam"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "externalIds": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- },
- "example": {
- "maintenanceId": "ABFS18600"
- }
- },
- "harsh_accel_setting": {
- "description": "Harsh Event Detection Setting\n* 0: Passenger\n* 1: Light Truck\n* 2: Heavy\n* 3: Off\n* 4: Automatic",
- "type": "integer",
- "format": "string",
- "enum": [
- "Passenger",
- "Light Truck",
- "Heavy",
- "Off",
- "Auto"
- ]
- },
- "name": {
- "description": "Name",
- "type": "string"
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "The updated vehicle.",
- "schema": {
- "$ref": "#/definitions/FleetVehicleResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/fleet/vehicles/{vehicle_id}/dispatch/routes": {
- "get": {
- "description": "Fetch all of the dispatch routes for a given vehicle.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/vehicles/{vehicle_id}/dispatch/routes",
- "operationId": "getDispatchRoutesByVehicleId",
- "parameters": [
- {
- "$ref": "#/parameters/routeEndTimeParam"
- },
- {
- "$ref": "#/parameters/routeDurationParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns all of the dispatch routes for the given vehicle_id.",
- "schema": {
- "$ref": "#/definitions/DispatchRoutes"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Create a new dispatch route for the vehicle with vehicle_id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet",
- "Routes"
- ],
- "summary": "/fleet/vehicles/{vehicle_id}/dispatch/routes",
- "operationId": "createVehicleDispatchRoute",
- "parameters": [
- {
- "$ref": "#/parameters/routeCreateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Created route object including the new route ID.",
- "schema": {
- "$ref": "#/definitions/DispatchRoute"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the vehicle with the associated routes. Must contain only digits 0-9.",
- "name": "vehicle_id",
- "in": "path",
- "required": true
- }
- ]
- },
- "/v1/fleet/vehicles/{vehicle_id}/locations": {
- "get": {
- "description": "Fetch locations for a given vehicle between a start/end time. The maximum query duration is one hour.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Fleet"
- ],
- "summary": "/fleet/vehicles/{vehicle_id}/locations",
- "operationId": "getVehicleLocations",
- "responses": {
- "200": {
- "description": "Returns locations for a given vehicle between a start/end time, with a maximum query duration of one hour.",
- "schema": {
- "$ref": "#/definitions/FleetVehicleLocations"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the vehicle with the associated routes. Must contain only digits 0-9.",
- "name": "vehicle_id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Time in Unix epoch milliseconds for the start of the query (cannot exceed 1 hour)",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "Time in Unix epoch milliseconds for the end of the query (cannot exceed 1 hour)",
- "name": "endMs",
- "in": "query",
- "required": true
- }
- ]
- },
- "/v1/industrial/data": {
- "get": {
- "description": "Fetch all of the data inputs for a group.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/data",
- "operationId": "getAllDataInputs",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdParam"
- },
- {
- "$ref": "#/parameters/dataInputStartTimeParam"
- },
- {
- "$ref": "#/parameters/dataInputEndTimeParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of data inputs.",
- "schema": {
- "type": "object",
- "properties": {
- "dataInputs": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DataInputHistoryResponse"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/industrial/data/{data_input_id}": {
- "get": {
- "description": "Fetch datapoints from a given data input.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/data/{data_input_id}",
- "operationId": "getDataInput",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/dataInputIdParam"
- },
- {
- "$ref": "#/parameters/dataInputStartTimeParam"
- },
- {
- "$ref": "#/parameters/dataInputEndTimeParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns datapoints for the given data input",
- "schema": {
- "$ref": "#/definitions/DataInputHistoryResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/industrial/vision/cameras": {
- "get": {
- "description": "Fetch all cameras.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/vision/cameras",
- "operationId": "getCameras",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns details about a camera.",
- "schema": {
- "$ref": "#/definitions/VisionCamerasResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/industrial/vision/cameras/{camera_id}/programs": {
- "get": {
- "description": "Fetch configured programs on the camera.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/vision/cameras/{camera_id}/programs",
- "operationId": "getVisionProgramsByCamera",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/visionCameraIdParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns programs configured on the camera.",
- "schema": {
- "$ref": "#/definitions/ProgramsForTheCameraResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/industrial/vision/run/camera/{camera_id}": {
- "get": {
- "description": "Fetch the latest run for a camera or program by default. If startedAtMs is supplied, fetch the specific run that corresponds to that start time.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/vision/run/camera/{camera_id}",
- "operationId": "getVisionLatestRunCamera",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/visionCameraIdParam"
- },
- {
- "$ref": "#/parameters/visionProgramIdParam"
- },
- {
- "$ref": "#/parameters/visionStartAtMsParam"
- },
- {
- "$ref": "#/parameters/visionIncludeParam"
- },
- {
- "$ref": "#/parameters/visionLimitParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Returns the details for this run.",
- "schema": {
- "$ref": "#/definitions/VisionRunByCameraResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/industrial/vision/runs": {
- "get": {
- "description": "Fetch runs.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/vision/runs",
- "operationId": "getVisionRuns",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/visionDurationMsParam"
- },
- {
- "$ref": "#/parameters/visionEndMsParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Return runs.",
- "schema": {
- "$ref": "#/definitions/VisionRunsResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/industrial/vision/runs/{camera_id}": {
- "get": {
- "description": "Fetch runs by camera.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Industrial"
- ],
- "summary": "/industrial/vision/runs/{camera_id}",
- "operationId": "getVisionRunsByCamera",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/visionCameraIdParam"
- },
- {
- "$ref": "#/parameters/visionDurationMsParam"
- },
- {
- "$ref": "#/parameters/visionEndMsParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Return runs by cameraId.",
- "schema": {
- "$ref": "#/definitions/VisionRunsByCameraResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/machines/history": {
- "post": {
- "description": "Get historical data for machine objects. This method returns a set of historical data for all machines in a group",
- "tags": [
- "Industrial"
- ],
- "summary": "/machines/history",
- "operationId": "getMachinesHistory",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "description": "Group ID and time range to query for events",
- "name": "historyParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "groupId",
- "startMs",
- "endMs"
- ],
- "properties": {
- "endMs": {
- "description": "End of the time range, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1462881998034
- },
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "startMs": {
- "description": "Beginning of the time range, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1462878398034
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "List of machine results objects, each containing a time and a datapoint.",
- "schema": {
- "$ref": "#/definitions/MachineHistoryResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/machines/list": {
- "post": {
- "description": "Get machine objects. This method returns a list of the machine objects in the Samsara Cloud and information about them.",
- "tags": [
- "Industrial"
- ],
- "summary": "/machines/list",
- "operationId": "getMachines",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdBodyParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of machine objects.",
- "schema": {
- "type": "object",
- "properties": {
- "machines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Machine"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/sensors/cargo": {
- "post": {
- "description": "Get cargo monitor status (empty / full) for requested sensors.",
- "tags": [
- "Sensors"
- ],
- "summary": "/sensors/cargo",
- "operationId": "getSensorsCargo",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/sensorParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of sensor objects containing the current cargo status reported by each sensor.",
- "schema": {
- "$ref": "#/definitions/CargoResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/sensors/door": {
- "post": {
- "description": "Get door monitor status (closed / open) for requested sensors.",
- "tags": [
- "Sensors"
- ],
- "summary": "/sensors/door",
- "operationId": "getSensorsDoor",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/sensorParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of sensor objects containing the current door status reported by each sensor.",
- "schema": {
- "$ref": "#/definitions/DoorResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/sensors/history": {
- "post": {
- "description": "Get historical data for specified sensors. This method returns a set of historical data for the specified sensors in the specified time range and at the specified time resolution.",
- "tags": [
- "Sensors"
- ],
- "summary": "/sensors/history",
- "operationId": "getSensorsHistory",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "description": "Group ID, time range and resolution, and list of sensor ID, field pairs to query.",
- "name": "historyParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "groupId",
- "startMs",
- "endMs",
- "stepMs",
- "series"
- ],
- "properties": {
- "endMs": {
- "description": "End of the time range, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1462881998034
- },
- "fillMissing": {
- "type": "string",
- "default": "withNull",
- "enum": [
- "withNull",
- "withPrevious"
- ]
- },
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "series": {
- "type": "array",
- "items": {
- "description": "Sensor ID and field to query.",
- "type": "object",
- "required": [
- "widgetId",
- "field"
- ],
- "properties": {
- "field": {
- "description": "Field to query.",
- "type": "string",
- "enum": [
- "ambientTemperature",
- "cargoPercent",
- "currentLoop1Raw",
- "currentLoop1Mapped",
- "currentLoop2Raw",
- "currentLoop2Mapped",
- "doorClosed",
- "humidity",
- "pmPowerTotal",
- "pmPhase1Power",
- "pmPhase2Power",
- "pmPhase3Power",
- "pmPhase1PowerFactor",
- "pmPhase2PowerFactor",
- "pmPhase3PowerFactor",
- "probeTemperature"
- ],
- "example": "ambientTemperature"
- },
- "widgetId": {
- "description": "Sensor ID to query.",
- "type": "integer",
- "format": "int64",
- "example": 1
- }
- }
- }
- },
- "startMs": {
- "description": "Beginning of the time range, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1462878398034
- },
- "stepMs": {
- "description": "Time resolution for which data should be returned, in milliseconds. Specifying 3600000 will return data at hour intervals.",
- "type": "integer",
- "example": 3600000
- }
- }
- }
- }
- ],
- "responses": {
- "200": {
- "description": "List of results objects, each containing a time and a datapoint for each requested sensor/field pair.",
- "schema": {
- "$ref": "#/definitions/SensorHistoryResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/sensors/humidity": {
- "post": {
- "description": "Get humidity for requested sensors. This method returns the current relative humidity for the requested sensors.",
- "tags": [
- "Sensors"
- ],
- "summary": "/sensors/humidity",
- "operationId": "getSensorsHumidity",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/sensorParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of sensor objects containing the current humidity reported by each sensor.",
- "schema": {
- "$ref": "#/definitions/HumidityResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/sensors/list": {
- "post": {
- "description": "Get sensor objects. This method returns a list of the sensor objects in the Samsara Cloud and information about them.",
- "tags": [
- "Sensors"
- ],
- "summary": "/sensors/list",
- "operationId": "getSensors",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdBodyParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of sensor objects.",
- "schema": {
- "type": "object",
- "properties": {
- "sensors": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Sensor"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/sensors/temperature": {
- "post": {
- "description": "Get temperature for requested sensors. This method returns the current ambient temperature (and probe temperature if applicable) for the requested sensors.",
- "tags": [
- "Sensors"
- ],
- "summary": "/sensors/temperature",
- "operationId": "getSensorsTemperature",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/sensorParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of sensor objects containing the current temperature reported by each sensor.",
- "schema": {
- "$ref": "#/definitions/TemperatureResponse"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/tags": {
- "get": {
- "description": "Fetch all of the tags for a group.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Tags"
- ],
- "summary": "/tags",
- "operationId": "getAllTags",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/groupIdQueryParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of tags.",
- "schema": {
- "type": "object",
- "properties": {
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Tag"
- }
- }
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Create a new tag for the group.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Tags"
- ],
- "summary": "/tags",
- "operationId": "createTag",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/tagCreateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Newly created tag object, including the new tag ID.",
- "schema": {
- "$ref": "#/definitions/Tag"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/tags/{tag_id}": {
- "get": {
- "description": "Fetch a tag by id.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Tags"
- ],
- "summary": "/tags/{tag_id}",
- "operationId": "getTagById",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/tagPathParam"
- }
- ],
- "responses": {
- "200": {
- "description": "The tag corresponding to tag_id.",
- "schema": {
- "$ref": "#/definitions/Tag"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "put": {
- "description": "Update a tag with a new name and new members. This API call would replace all old members of a tag with new members specified in the request body. To modify only a few devices associated with a tag use the PATCH endpoint.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Tags"
- ],
- "summary": "/tags/{tag_id}",
- "operationId": "updateTagById",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/tagPathParam"
- },
- {
- "$ref": "#/parameters/tagUpdateParam"
- }
- ],
- "responses": {
- "200": {
- "description": "The updated tag data.",
- "schema": {
- "$ref": "#/definitions/Tag"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "delete": {
- "description": "Permanently deletes a tag.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Tags"
- ],
- "summary": "/tags/{tag_id}",
- "operationId": "deleteTagById",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/tagPathParam"
- }
- ],
- "responses": {
- "200": {
- "description": "Successfully deleted the tag. No response body is returned."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "patch": {
- "description": "Add or delete specific members from a tag, or modify the name of a tag.",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "Tags"
- ],
- "summary": "/tags/{tag_id}",
- "operationId": "modifyTagById",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/tagPathParam"
- },
- {
- "$ref": "#/parameters/tagModifyParam"
- }
- ],
- "responses": {
- "200": {
- "description": "The updated tag data.",
- "schema": {
- "$ref": "#/definitions/Tag"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/user_roles": {
- "get": {
- "description": "Get all roles in the organization.",
- "tags": [
- "Users"
- ],
- "summary": "/user_roles",
- "operationId": "listUserRoles",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of user roles.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/UserRole"
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/users": {
- "get": {
- "description": "List all users in the organization.",
- "tags": [
- "Users"
- ],
- "summary": "/users",
- "operationId": "listUsers",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- }
- ],
- "responses": {
- "200": {
- "description": "List of users.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/User"
- }
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "post": {
- "description": "Add a user to the organization.",
- "tags": [
- "Users"
- ],
- "summary": "/users",
- "operationId": "createUser",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/createUserParam"
- }
- ],
- "responses": {
- "200": {
- "description": "User successfully created.",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- },
- "/v1/users/{userId}": {
- "get": {
- "description": "Get a user.",
- "tags": [
- "Users"
- ],
- "summary": "/users/{userId}",
- "operationId": "getUserById",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/createUserParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the user. Must contain only digits 0-9.",
- "name": "userId",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "User record.",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "delete": {
- "description": "Remove a user from the organization.",
- "tags": [
- "Users"
- ],
- "summary": "/users/{userId}",
- "operationId": "deleteUserById",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the user. Must contain only digits 0-9.",
- "name": "userId",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "The user was successfully removed."
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- },
- "patch": {
- "description": "Update some fields on a user. Only fields to be changed need to be supplied. Note that if you change an object or collection, you must supply the complete collection. For example, to add a tag role to a user, you must specify all tag roles that the user should have.",
- "tags": [
- "Users"
- ],
- "summary": "/users/{userId}",
- "operationId": "patchUser",
- "parameters": [
- {
- "$ref": "#/parameters/accessTokenParam"
- },
- {
- "$ref": "#/parameters/updateUserParam"
- },
- {
- "type": "integer",
- "format": "int64",
- "description": "ID of the user. Must contain only digits 0-9.",
- "name": "userId",
- "in": "path",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "User successfully updated.",
- "schema": {
- "$ref": "#/definitions/User"
- }
- },
- "default": {
- "description": "Unexpected error.",
- "schema": {
- "$ref": "#/definitions/ErrorResponse"
- }
- }
- }
- }
- }
- },
- "definitions": {
- "Address": {
- "description": "Information about an address/geofence. Geofences are either a circle or a polygon.",
- "type": "object",
- "properties": {
- "contacts": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Contact"
- }
- },
- "formattedAddress": {
- "description": "The full address associated with this address/geofence, as it might be recognized by maps.google.com",
- "type": "string",
- "example": "350 Rhode Island St, San Francisco, CA"
- },
- "geofence": {
- "$ref": "#/definitions/AddressGeofence"
- },
- "id": {
- "description": "ID of the address",
- "type": "integer",
- "format": "int64",
- "example": 123
- },
- "name": {
- "description": "Name of the address or geofence",
- "type": "string",
- "example": "Samsara HQ"
- },
- "notes": {
- "$ref": "#/definitions/AddressNotes"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TagMetadata"
- }
- }
- }
- },
- "AddressGeofence": {
- "description": "The geofence that defines this address and its bounds. This can either be a circle, or a polygon - only one key should be provided, depending on the geofence type.",
- "type": "object",
- "properties": {
- "circle": {
- "description": "Information about a circular geofence. This field is only populated if the geofence is a circle.",
- "type": "object",
- "properties": {
- "latitude": {
- "description": "The latitude of the center of the circular geofence",
- "type": "number",
- "format": "double",
- "example": 37.765363
- },
- "longitude": {
- "description": "The longitude of the center of the circular geofence",
- "type": "number",
- "format": "double",
- "example": -122.403098
- },
- "radiusMeters": {
- "description": "The radius of the circular geofence",
- "type": "number",
- "format": "integer",
- "example": 250
- }
- }
- },
- "polygon": {
- "description": "Information about a polygon geofence. This field is only populated if the geofence is a polygon.",
- "type": "object",
- "properties": {
- "vertices": {
- "description": "The vertices of the polygon geofence. These geofence vertices describe the perimeter of the polygon, and must consist of at least 3 vertices and less than 40.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "latitude": {
- "description": "The longitude of a geofence vertex",
- "type": "number",
- "format": "double",
- "example": 37.765363
- },
- "longitude": {
- "description": "The longitude of a geofence vertex",
- "type": "number",
- "format": "double",
- "example": -122.403098
- }
- }
- }
- }
- }
- }
- }
- },
- "AddressNotes": {
- "description": "Notes associated with an address.",
- "type": "string",
- "example": "Delivery site 1"
- },
- "Asset": {
- "description": "Basic information of an asset",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "assetSerialNumber": {
- "description": "Serial number of the host asset",
- "type": "string",
- "example": "SNTEST123"
- },
- "cable": {
- "description": "The cable connected to the asset",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "assetType": {
- "description": "Asset type",
- "type": "string",
- "example": "Reefer (Thermo King)"
- }
- }
- }
- },
- "engineHours": {
- "description": "Engine hours",
- "type": "integer",
- "example": 104
- },
- "id": {
- "description": "Asset ID",
- "type": "integer",
- "format": "int64",
- "example": 1
- },
- "name": {
- "description": "Asset name",
- "type": "string",
- "example": "Trailer 123"
- }
- }
- },
- "AssetCurrentLocation": {
- "description": "Current location of an asset",
- "type": "object",
- "properties": {
- "latitude": {
- "description": "The latitude of the location in degrees.",
- "type": "number",
- "example": 37
- },
- "location": {
- "description": "The best effort (street,city,state) for the latitude and longitude.",
- "type": "string",
- "example": "525 York, San Francisco, CA"
- },
- "longitude": {
- "description": "The longitude of the location in degrees.",
- "type": "number",
- "example": -122.7
- },
- "speedMilesPerHour": {
- "description": "The speed calculated from GPS that the asset was traveling at in miles per hour.",
- "type": "number",
- "example": 35
- },
- "timeMs": {
- "description": "Time in Unix milliseconds since epoch when the asset was at the location.",
- "type": "number",
- "example": 12314151
- }
- }
- },
- "AssetCurrentLocationsResponse": {
- "description": "Basic information of an asset",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "cable": {
- "description": "The cable connected to the asset",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "assetType": {
- "description": "Asset type",
- "type": "string",
- "example": "Reefer (Thermo King)"
- }
- }
- }
- },
- "engineHours": {
- "description": "Engine hours",
- "type": "integer",
- "example": 104
- },
- "id": {
- "description": "Asset ID",
- "type": "integer",
- "format": "int64",
- "example": 1
- },
- "location": {
- "description": "Current location of an asset",
- "type": "array",
- "items": {
- "$ref": "#/definitions/AssetCurrentLocation"
- }
- },
- "name": {
- "description": "Asset name",
- "type": "string",
- "example": "Trailer 123"
- }
- }
- },
- "AssetLocationResponse": {
- "description": "A list of historical asset locations.",
- "type": "array",
- "items": {
- "description": "Asset location details.",
- "type": "object",
- "properties": {
- "latitude": {
- "description": "The latitude of the location in degrees.",
- "type": "number",
- "example": 37
- },
- "location": {
- "description": "The best effort (street,city,state) for the latitude and longitude.",
- "type": "string",
- "example": "525 York, San Francisco, CA"
- },
- "longitude": {
- "description": "The longitude of the location in degrees.",
- "type": "number",
- "example": -122.7
- },
- "speedMilesPerHour": {
- "description": "The speed calculated from GPS that the asset was traveling at in miles per hour.",
- "type": "number",
- "example": 35
- },
- "time": {
- "description": "Time in Unix milliseconds since epoch when the asset was at the location.",
- "type": "number",
- "example": 12314151
- }
- }
- }
- },
- "AssetReeferResponse": {
- "description": "Reefer-specific asset details",
- "type": "object",
- "properties": {
- "assetType": {
- "description": "Asset type",
- "type": "string",
- "example": "Reefer (Thermo King)"
- },
- "id": {
- "description": "Asset ID",
- "type": "integer",
- "example": 1
- },
- "name": {
- "description": "Asset name",
- "type": "string",
- "example": "Reefer 123"
- },
- "reeferStats": {
- "type": "object",
- "properties": {
- "alarms": {
- "description": "Reefer alarms",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "alarms": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "alarmCode": {
- "description": "ID of the alarm",
- "type": "integer",
- "format": "int64",
- "example": 102
- },
- "description": {
- "description": "Description of the alarm",
- "type": "string",
- "example": "Check Return Air Sensor"
- },
- "operatorAction": {
- "description": "Recommended operator action",
- "type": "string",
- "example": "Check and repair at end of trip"
- },
- "severity": {
- "description": "Severity of the alarm: 1: OK to run, 2: Check as specified, 3: Take immediate action",
- "type": "integer",
- "format": "int64",
- "example": 1
- }
- }
- }
- },
- "changedAtMs": {
- "description": "Timestamp when the alarms were reported, in Unix milliseconds since epoch",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- }
- }
- }
- },
- "engineHours": {
- "description": "Engine hours of the reefer",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "changedAtMs": {
- "description": "Timestamp in Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "engineHours": {
- "description": "Engine hours of the reefer.",
- "type": "integer",
- "format": "int64",
- "example": 1200
- }
- }
- }
- },
- "fuelPercentage": {
- "description": "Fuel percentage of the reefer",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "changedAtMs": {
- "description": "Timestamp in Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "fuelPercentage": {
- "description": "Fuel percentage of the reefer.",
- "type": "integer",
- "format": "int64",
- "example": 99
- }
- }
- }
- },
- "powerStatus": {
- "description": "Power status of the reefer",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "changedAtMs": {
- "description": "Timestamp in Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "status": {
- "description": "Power status of the reefer.",
- "type": "string",
- "example": "Active (Continuous)"
- }
- }
- }
- },
- "returnAirTemp": {
- "description": "Return air temperature of the reefer",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "changedAtMs": {
- "description": "Timestamp in Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "tempInMilliC": {
- "description": "Return air temperature in millidegree Celsius.",
- "type": "integer",
- "format": "int64",
- "example": 31110
- }
- }
- }
- },
- "setPoint": {
- "description": "Set point temperature of the reefer",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "changedAtMs": {
- "description": "Timestamp in Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "tempInMilliC": {
- "description": "Set point temperature in millidegree Celsius.",
- "type": "integer",
- "format": "int64",
- "example": 31110
- }
- }
- }
- }
- }
- }
- }
- },
- "AuxInput": {
- "description": "Digital value of an aux input.",
- "type": "object",
- "required": [
- "timeMs",
- "value"
- ],
- "properties": {
- "timeMs": {
- "description": "Timestamp in Unix epoch milliseconds.",
- "type": "number",
- "format": "int64",
- "example": 1546542978484
- },
- "value": {
- "description": "Boolean representing the digital value of the aux input.",
- "type": "boolean",
- "example": true
- }
- }
- },
- "AuxInputSeries": {
- "description": "A list of aux input values over a timerange.",
- "type": "object",
- "required": [
- "name",
- "values"
- ],
- "properties": {
- "name": {
- "description": "The name of the aux input.",
- "type": "string",
- "enum": [
- "Emergency Lights",
- "Emergency Alarm",
- "Stop Paddle",
- "Power Take-Off",
- "Plow",
- "Sweeper",
- "Salter",
- "Boom"
- ],
- "example": "Boom"
- },
- "values": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/AuxInput"
- }
- }
- }
- },
- "CargoResponse": {
- "description": "Contains the current cargo status of a sensor.",
- "type": "object",
- "properties": {
- "groupId": {
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "sensors": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "cargoEmpty": {
- "description": "Flag indicating whether the current cargo is empty or loaded.",
- "type": "boolean",
- "example": true
- },
- "id": {
- "description": "ID of the sensor.",
- "type": "integer",
- "format": "int64",
- "example": 122
- },
- "name": {
- "description": "Name of the sensor.",
- "type": "string",
- "example": "Trailer Cargo Sensor"
- }
- }
- }
- }
- }
- },
- "Contact": {
- "description": "Information about a notification contact for alerts.",
- "type": "object",
- "properties": {
- "email": {
- "description": "Email address of the contact",
- "type": "string",
- "example": "jane.jones@yahoo.com"
- },
- "firstName": {
- "description": "First name of the contact",
- "type": "string",
- "example": "Jane"
- },
- "id": {
- "description": "ID of the contact",
- "type": "integer",
- "format": "int64",
- "example": 123
- },
- "lastName": {
- "description": "Last name of the contact",
- "type": "string",
- "example": "Jones"
- },
- "phone": {
- "description": "Phone number of the contact",
- "type": "string",
- "example": "111-222-3344"
- }
- }
- },
- "ContactData": {
- "description": "Information about a notification contact for alerts.",
- "type": "object",
- "properties": {
- "data": {
- "$ref": "#/definitions/Contact"
- }
- }
- },
- "ContactIds": {
- "description": "A list of IDs for contact book entries.",
- "type": "array",
- "items": {
- "type": "number",
- "format": "int64",
- "example": 123
- }
- },
- "ContactInput": {
- "description": "Information for adding a notification contact for alerts.",
- "type": "object",
- "properties": {
- "email": {
- "description": "Email address of the contact",
- "type": "string",
- "example": "jane.jones@yahoo.com"
- },
- "firstName": {
- "description": "First name of the contact",
- "type": "string",
- "example": "Jane"
- },
- "lastName": {
- "description": "Last name of the contact",
- "type": "string",
- "example": "Jones"
- },
- "phone": {
- "description": "Phone number of the contact",
- "type": "string",
- "example": "111-222-3344"
- }
- }
- },
- "CurrentDriver": {
- "$ref": "#/definitions/Driver"
- },
- "DataInputHistoryResponse": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "id": {
- "description": "The ID of this data input",
- "type": "integer",
- "format": "int64",
- "example": 12345
- },
- "name": {
- "description": "Name of this data input",
- "type": "string",
- "example": "Pump Flow"
- },
- "points": {
- "description": "Data points from this data input",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "timeMs": {
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "value": {
- "type": "number",
- "format": "double",
- "example": 12.332
- }
- }
- }
- }
- }
- },
- "DispatchJob": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "id",
- "group_id",
- "dispatch_route_id",
- "job_state"
- ],
- "properties": {
- "arrived_at_ms": {
- "description": "The time at which the driver arrived at the job destination.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "completed_at_ms": {
- "description": "The time at which the job was marked complete (e.g. started driving to the next destination).",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "dispatch_route_id": {
- "description": "ID of the route that this job belongs to.",
- "type": "integer",
- "format": "int64",
- "example": 55
- },
- "documents": {
- "description": "Document submissions associated with this job.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DispatchJobDocumentInfo"
- }
- },
- "driver_id": {
- "description": "ID of the driver assigned to the dispatch job.",
- "type": "integer",
- "format": "int64",
- "example": 444
- },
- "en_route_at_ms": {
- "description": "The time at which the assigned driver started fulfilling the job (e.g. started driving to the destination).",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "estimated_arrival_ms": {
- "description": "The time at which the assigned driver is estimated to arrive at the job destination. Only valid for en-route jobs.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "fleet_viewer_url": {
- "description": "Fleet viewer url of the dispatch job.",
- "type": "string",
- "example": "https://cloud.samsara.com/fleet/viewer/job/fleet_viewer_token"
- },
- "group_id": {
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "id": {
- "description": "ID of the Samsara dispatch job.",
- "type": "integer",
- "format": "int64",
- "example": 773
- },
- "job_state": {
- "$ref": "#/definitions/jobStatus"
- },
- "skipped_at_ms": {
- "description": "The time at which the job was marked skipped.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "vehicle_id": {
- "description": "ID of the vehicle used for the dispatch job.",
- "type": "integer",
- "format": "int64",
- "example": 112
- }
- }
- },
- {
- "$ref": "#/definitions/DispatchJobCreate"
- }
- ]
- },
- "DispatchJobCreate": {
- "type": "object",
- "required": [
- "scheduled_arrival_time_ms"
- ],
- "properties": {
- "destination_address": {
- "description": "The address of the job destination, as it would be recognized if provided to maps.google.com. Optional if a valid destination address ID is provided.",
- "type": "string",
- "example": "123 Main St, Philadelphia, PA 19106"
- },
- "destination_address_id": {
- "description": "ID of the job destination associated with an address book entry. Optional if valid values are provided for destination address and latitude/longitude. If a valid destination 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 destination name is not provided.",
- "type": "integer",
- "format": "int64",
- "example": 67890
- },
- "destination_lat": {
- "description": "Latitude of the destination in decimal degrees. Optional if a valid destination address ID is provided.",
- "type": "number",
- "format": "double",
- "example": 123.456
- },
- "destination_lng": {
- "description": "Longitude of the destination in decimal degrees. Optional if a valid destination address ID is provided.",
- "type": "number",
- "format": "double",
- "example": 37.459
- },
- "destination_name": {
- "description": "The name of the job destination. If provided, it will take precedence over the name of the address book entry.",
- "type": "string",
- "example": "ACME Inc. Philadelphia HQ"
- },
- "notes": {
- "description": "Notes regarding the details of this job.",
- "type": "string",
- "example": "Ensure crates are stacked no more than 3 high."
- },
- "scheduled_arrival_time_ms": {
- "description": "The time at which the assigned driver is scheduled to arrive at the job destination.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "scheduled_departure_time_ms": {
- "description": "The time at which the assigned driver is scheduled to depart from the job destination.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- }
- }
- },
- "DispatchJobDocumentInfo": {
- "type": "object",
- "required": [
- "driverId",
- "id"
- ],
- "properties": {
- "driverId": {
- "description": "ID of driver that submitted the document.",
- "type": "integer",
- "example": 1234
- },
- "id": {
- "description": "ID of document. This can be used to query for the document's info via the /v1/fleet/drivers/{driver_id}/documents/{document_id} endpoint",
- "type": "string",
- "example": "2018_42424242"
- }
- }
- },
- "DispatchJobUpdate": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "id",
- "dispatch_jobs"
- ],
- "properties": {
- "id": {
- "description": "ID of the Samsara dispatch job to update",
- "type": "integer",
- "format": "int64",
- "example": 42
- }
- }
- },
- {
- "$ref": "#/definitions/DispatchJobCreate"
- }
- ]
- },
- "DispatchRoute": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "id",
- "dispatch_jobs"
- ],
- "properties": {
- "dispatch_jobs": {
- "description": "The dispatch jobs associated with this route.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DispatchJob"
- }
- },
- "id": {
- "description": "ID of the Samsara dispatch route.",
- "type": "integer",
- "format": "int64",
- "example": 556
- }
- }
- },
- {
- "$ref": "#/definitions/DispatchRouteBase"
- }
- ]
- },
- "DispatchRouteBase": {
- "type": "object",
- "required": [
- "name",
- "scheduled_start_ms",
- "scheduled_end_ms"
- ],
- "properties": {
- "actual_end_ms": {
- "description": "The time in Unix epoch milliseconds that the route actually ended.",
- "type": "integer",
- "format": "int64",
- "example": 1462882101000
- },
- "actual_start_ms": {
- "description": "The time in Unix epoch milliseconds that the route actually started.",
- "type": "integer",
- "format": "int64",
- "example": 1462882098000
- },
- "driver_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 555
- },
- "group_id": {
- "description": "ID of the group if the organization has multiple groups (optional).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "name": {
- "description": "Descriptive name of this route.",
- "type": "string",
- "example": "Bid #123"
- },
- "odometer_end_meters": {
- "description": "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": "integer",
- "format": "int64",
- "example": 2000000
- },
- "odometer_start_meters": {
- "description": "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": "integer",
- "format": "int64",
- "example": 1000000
- },
- "scheduled_end_ms": {
- "description": "The time in Unix epoch milliseconds that the last job in the route is scheduled to end.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "scheduled_meters": {
- "description": "The distance expected to be traveled for this route in meters.",
- "type": "integer",
- "format": "int64",
- "example": 10000
- },
- "scheduled_start_ms": {
- "description": "The time in Unix epoch milliseconds that the route is scheduled to start.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "start_location_address": {
- "description": "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",
- "example": "123 Main St, Philadelphia, PA 19106"
- },
- "start_location_address_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 67890
- },
- "start_location_lat": {
- "description": "Latitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
- "type": "number",
- "format": "double",
- "example": 123.456
- },
- "start_location_lng": {
- "description": "Longitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
- "type": "number",
- "format": "double",
- "example": 37.459
- },
- "start_location_name": {
- "description": "The name of the route's starting location. If provided, it will take precedence over the name of the address book entry.",
- "type": "string",
- "example": "ACME Inc. Philadelphia HQ"
- },
- "trailer_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 666
- },
- "vehicle_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 444
- }
- }
- },
- "DispatchRouteCreate": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "dispatch_jobs"
- ],
- "properties": {
- "dispatch_jobs": {
- "description": "The dispatch jobs to create for this route.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DispatchJobCreate"
- }
- }
- }
- },
- {
- "$ref": "#/definitions/DispatchRouteCreateBase"
- }
- ]
- },
- "DispatchRouteCreateBase": {
- "type": "object",
- "required": [
- "name",
- "scheduled_start_ms"
- ],
- "properties": {
- "driver_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 555
- },
- "group_id": {
- "description": "ID of the group if the organization has multiple groups (optional).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "name": {
- "description": "Descriptive name of this route.",
- "type": "string",
- "example": "Bid #123"
- },
- "scheduled_end_ms": {
- "description": "The time in Unix epoch milliseconds that the last job in the route is scheduled to end.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "scheduled_meters": {
- "description": "The distance expected to be traveled for this route in meters.",
- "type": "integer",
- "format": "int64",
- "example": 10000
- },
- "scheduled_start_ms": {
- "description": "The time in Unix epoch milliseconds that the route is scheduled to start.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "start_location_address": {
- "description": "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",
- "example": "123 Main St, Philadelphia, PA 19106"
- },
- "start_location_address_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 67890
- },
- "start_location_lat": {
- "description": "Latitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
- "type": "number",
- "format": "double",
- "example": 123.456
- },
- "start_location_lng": {
- "description": "Longitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
- "type": "number",
- "format": "double",
- "example": 37.459
- },
- "start_location_name": {
- "description": "The name of the route's starting location. If provided, it will take precedence over the name of the address book entry.",
- "type": "string",
- "example": "ACME Inc. Philadelphia HQ"
- },
- "trailer_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 666
- },
- "vehicle_id": {
- "description": "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": "integer",
- "format": "int64",
- "example": 444
- }
- }
- },
- "DispatchRouteHistoricalEntry": {
- "type": "object",
- "properties": {
- "changed_at_ms": {
- "description": "Timestamp that the route was updated, represented as Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1499411220000
- },
- "route": {
- "$ref": "#/definitions/DispatchRoute"
- }
- }
- },
- "DispatchRouteHistory": {
- "type": "object",
- "properties": {
- "history": {
- "description": "History of the route's state changes.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DispatchRouteHistoricalEntry"
- }
- }
- }
- },
- "DispatchRouteUpdate": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "dispatch_jobs"
- ],
- "properties": {
- "dispatch_jobs": {
- "description": "The dispatch jobs for the route.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DispatchJobUpdate"
- }
- }
- }
- },
- {
- "$ref": "#/definitions/DispatchRouteUpdateBase"
- }
- ]
- },
- "DispatchRouteUpdateBase": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "ID of route. This must match the route ID passed in URL.",
- "type": "integer",
- "format": "int64",
- "example": "42"
- }
- }
- },
- {
- "$ref": "#/definitions/DispatchRouteCreateBase"
- }
- ]
- },
- "DispatchRoutes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DispatchRoute"
- }
- },
- "Document": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "id",
- "orgId",
- "driverId",
- "driverCreatedAtMs",
- "documentType",
- "fields"
- ],
- "properties": {
- "documentType": {
- "description": "Descriptive name of this type of document.",
- "type": "string",
- "example": "Fuel Receipt"
- },
- "driverCreatedAtMs": {
- "description": "The time in Unix epoch milliseconds that the document is created.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "driverId": {
- "description": "ID of the driver for whom the document is submitted",
- "type": "integer",
- "format": "int64",
- "example": 555
- },
- "fields": {
- "description": "The fields associated with this document.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DocumentField"
- },
- "example": [
- {
- "label": "Photos",
- "photoValue": [],
- "valueType": "ValueType_Photo"
- },
- {
- "label": "Gallons",
- "numberValue": 12.34,
- "valueType": "ValueType_Number"
- },
- {
- "label": "City",
- "stringValue": "San Francisco, CA",
- "valueType": "ValueType_String"
- },
- {
- "label": "Fuel Type",
- "multipleChoiceValue": [
- {
- "selected": true,
- "value": "Diesel"
- },
- {
- "selected": false,
- "value": "Gas"
- }
- ],
- "valueType": "ValueType_MultipleChoice"
- }
- ]
- },
- "id": {
- "description": "ID of the document",
- "type": "string",
- "example": "2018_42424242"
- },
- "orgId": {
- "description": "Organization ID that the document \u0026 driver who submitted the doc belongs to",
- "type": "integer",
- "format": "int64",
- "example": 555
- },
- "vehicleId": {
- "description": "VehicleID of the driver at document creation.",
- "type": "integer",
- "format": "int64",
- "example": 222
- }
- }
- },
- {
- "$ref": "#/definitions/DocumentBase"
- }
- ]
- },
- "DocumentBase": {
- "type": "object",
- "required": [
- "dispatchJobId",
- "notes"
- ],
- "properties": {
- "dispatchJobId": {
- "description": "ID of the Samsara dispatch job for which the document is submitted",
- "type": "integer",
- "format": "int64",
- "example": 773
- },
- "notes": {
- "description": "Notes submitted with this document.",
- "type": "string",
- "example": "Fueled up before delivery."
- }
- }
- },
- "DocumentCreate": {
- "allOf": [
- {
- "description": "Arguments to create a document.",
- "type": "object",
- "required": [
- "documentTypeUuid",
- "fields"
- ],
- "properties": {
- "documentTypeUuid": {
- "description": "Universally unique identifier for the document type this document is being created for.",
- "type": "string",
- "example": "4aff772c-a7bb-45e6-8e41-6a53e34feb83"
- },
- "fields": {
- "description": "List of fields and associated values for a given document. The fields must be listed in the order that that they appear in the specificied document type. Today `stringValue` and `numberValue` are the two supported document upload field types.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DocumentField"
- },
- "example": [
- {
- "label": "Gallons",
- "numberValue": 12.34,
- "valueType": "ValueType_Number"
- },
- {
- "label": "City",
- "stringValue": "San Francisco, CA",
- "valueType": "ValueType_String"
- },
- {
- "label": "Fuel Type",
- "multipleChoiceValue": [
- {
- "selected": true,
- "value": "Diesel"
- },
- {
- "selected": false,
- "value": "Gas"
- }
- ],
- "valueType": "ValueType_MultipleChoice"
- }
- ]
- }
- }
- },
- {
- "$ref": "#/definitions/DocumentCreateBase"
- }
- ]
- },
- "DocumentCreateBase": {
- "type": "object",
- "properties": {
- "dispatchJobId": {
- "description": "ID of the Samsara dispatch job for which the document is submitted",
- "type": "integer",
- "format": "int64",
- "example": 773
- },
- "notes": {
- "description": "Notes submitted with this document.",
- "type": "string",
- "example": "Fueled up before delivery."
- }
- }
- },
- "DocumentField": {
- "allOf": [
- {
- "description": "A field of a document. A field can be a string type, number type, or photo type, which can be identified from its valueType. Between stringValue, numberValue, and photoValue, only one can exist for a single document field depending on the valueType.",
- "type": "object",
- "required": [
- "label"
- ],
- "properties": {
- "label": {
- "description": "Descriptive name of this field.",
- "type": "string",
- "example": "Fuel Cost ($)"
- },
- "value": {
- "description": "DEPRECATED: Please use stringValue, numberValue, or photoValue instead. Value of this field. Depending on what kind of field it is, this may be one of the following: an array of image urls, a float, an integer, or a string.",
- "example": 23.45
- }
- }
- },
- {
- "$ref": "#/definitions/DocumentFieldCreate"
- }
- ]
- },
- "DocumentFieldCreate": {
- "type": "object",
- "required": [
- "valueType"
- ],
- "properties": {
- "multipleChoiceValue": {
- "description": "Value of this field if this document field has valueType: ValueType_MultipleChoice. Array of objects containing two fields: the string value of the multiple choice option and a boolean representing whether or not the choice was selected",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "selected": {
- "type": "boolean"
- },
- "value": {
- "type": "string"
- }
- }
- }
- },
- "numberValue": {
- "description": "Value of this field if this document field has valueType: ValueType_Number.",
- "type": "number",
- "format": "double",
- "example": 12.34
- },
- "photoValue": {
- "description": "Value of this field if this document field has valueType: ValueType_Photo. Array of photo objects where each object contains a URL for a photo.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "url": {
- "description": "Photo URL for a JPG image",
- "type": "string"
- }
- }
- },
- "example": [
- {
- "url": "https://www.samsara.com/photo1"
- },
- {
- "url": "https://www.samsara.com/photo2"
- }
- ]
- },
- "stringValue": {
- "description": "Value of this field if this document field has valueType: ValueType_String.",
- "type": "string",
- "example": "This is a string."
- },
- "valueType": {
- "description": "Determines the type of this field and what type of value this field has. It should be either ValueType_Number, ValueType_String, or ValueType_Photo.",
- "type": "string",
- "example": "ValueType_Number"
- }
- }
- },
- "DocumentFieldType": {
- "type": "object",
- "required": [
- "label",
- "valueType"
- ],
- "properties": {
- "label": {
- "description": "Descriptive name of this field type.",
- "type": "string",
- "example": "Fuel Cost ($)"
- },
- "numberValueTypeMetadata": {
- "description": "Additional metadata information for a number field type. Only defined when a field type has valueType: ValueType_Number.",
- "type": "object",
- "properties": {
- "numDecimalPlaces": {
- "description": "Number of decimal places that values for this field type can have.",
- "type": "number",
- "format": "int64",
- "example": 2
- }
- }
- },
- "valueType": {
- "description": "The kind of value that can be submitted for this fieldType. It should be either ValueType_Number, ValueType_String, or ValueType_Photo.",
- "type": "string",
- "example": "ValueType_Number"
- }
- }
- },
- "DocumentFieldTypes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DocumentFieldType"
- }
- },
- "DocumentType": {
- "type": "object",
- "required": [
- "name",
- "orgId",
- "uuid"
- ],
- "properties": {
- "fieldTypes": {
- "description": "The field types determine the names of fields for this document type. They also determine the types of values a document submitted for this document type can have.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/DocumentFieldTypes"
- }
- },
- "name": {
- "description": "Name of the document type.",
- "type": "string",
- "example": "Fuel Receipt"
- },
- "orgId": {
- "description": "ID for the organization this document belongs to.",
- "type": "integer",
- "format": "int64",
- "example": 773
- },
- "uuid": {
- "description": "Universally unique identifier for the document type. Can be passed in as a documentTypeUuid when creating a document for this document type.",
- "type": "string",
- "example": "4aff772c-a7bb-45e6-8e41-6a53e34feb83"
- }
- }
- },
- "DocumentTypes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DocumentType"
- }
- },
- "Documents": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Document"
- }
- },
- "DoorResponse": {
- "description": "Contains the current door status of a sensor.",
- "type": "object",
- "properties": {
- "groupId": {
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "sensors": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "doorClosed": {
- "description": "Flag indicating whether the current door is closed or open.",
- "type": "boolean",
- "example": true
- },
- "id": {
- "description": "ID of the sensor.",
- "type": "integer",
- "format": "int64",
- "example": 122
- },
- "name": {
- "description": "Name of the sensor.",
- "type": "string",
- "example": "Trailer Door Sensor"
- }
- }
- }
- }
- }
- },
- "Driver": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "ID of the driver.",
- "type": "integer",
- "format": "int64",
- "example": 556
- },
- "isDeactivated": {
- "description": "True if the driver account has been deactivated.",
- "type": "boolean"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TagMetadata"
- }
- }
- }
- },
- {
- "type": "object",
- "properties": {
- "currentVehicleId": {
- "description": "ID of the vehicle that this driver is currently assigned to. Omitted if there is no current vehicle assignment for this driver.",
- "type": "integer",
- "format": "int64",
- "example": 879
- }
- }
- },
- {
- "$ref": "#/definitions/DriverBase"
- }
- ]
- },
- "DriverBase": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "eldAdverseWeatherExemptionEnabled": {
- "description": "Flag indicating this driver may use Adverse Weather exemptions in ELD logs.",
- "type": "boolean"
- },
- "eldBigDayExemptionEnabled": {
- "description": "Flag indicating this driver may use Big Day excemptions in ELD logs.",
- "type": "boolean"
- },
- "eldDayStartHour": {
- "description": "0 indicating midnight-to-midnight ELD driving hours, 12 to indicate noon-to-noon driving hours.",
- "type": "integer"
- },
- "eldExempt": {
- "description": "Flag indicating this driver is exempt from the Electronic Logging Mandate.",
- "type": "boolean"
- },
- "eldExemptReason": {
- "description": "Reason that this driver is exempt from the Electronic Logging Mandate (see eldExempt).",
- "type": "string"
- },
- "eldPcEnabled": {
- "description": "Flag indicating this driver may select the Personal Conveyance duty status in ELD logs.",
- "type": "boolean",
- "default": false
- },
- "eldYmEnabled": {
- "description": "Flag indicating this driver may select the Yard Move duty status in ELD logs.",
- "type": "boolean",
- "default": false
- },
- "externalIds": {
- "description": "Dictionary of external IDs (string key-value pairs)",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- },
- "example": {
- "maintenanceId": "250020",
- "payrollId": "123"
- }
- },
- "groupId": {
- "description": "ID of the group if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "licenseNumber": {
- "description": "Driver's state issued license number.",
- "type": "string",
- "example": "E1234567"
- },
- "licenseState": {
- "description": "Abbreviation of state that issued driver's license.",
- "type": "string",
- "example": "CA"
- },
- "name": {
- "description": "Driver's name.",
- "type": "string",
- "example": "Susan Jones"
- },
- "notes": {
- "description": "Notes about the driver.",
- "type": "string",
- "example": "Also goes by the nickname 'Furious Fred'."
- },
- "phone": {
- "description": "Driver's phone number. Please include only digits, ex. 4157771234",
- "type": "string",
- "example": "5558234327"
- },
- "username": {
- "description": "Driver's login username into the driver app.",
- "type": "string",
- "example": "Susan Jones"
- },
- "vehicleId": {
- "description": "ID of the vehicle assigned to the driver for static vehicle assignments. (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 444
- }
- }
- },
- "DriverDailyLogResponse": {
- "type": "object",
- "properties": {
- "days": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "activeHours": {
- "description": "Hours spent on duty or driving, rounded to two decimal places.",
- "type": "number",
- "format": "double",
- "example": 5.4
- },
- "activeMs": {
- "description": "Milliseconds spent on duty or driving.",
- "type": "integer",
- "format": "int64",
- "example": 691200
- },
- "certified": {
- "description": "Whether this HOS day chart was certified by the driver.",
- "type": "boolean"
- },
- "certifiedAtMs": {
- "description": "Unix epoch time (in ms) of time when this chart was certified. If this chart is uncertified, 0.",
- "type": "number",
- "format": "int64"
- },
- "distanceMiles": {
- "description": "Distance driven in miles, rounded to two decimal places.",
- "type": "number",
- "format": "double",
- "example": 123.24
- },
- "endMs": {
- "description": "End of the HOS day, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1473836400000
- },
- "startMs": {
- "description": "End of the HOS day, specified in milliseconds UNIX time.",
- "type": "integer",
- "example": 1473750000000
- },
- "trailerIds": {
- "description": "List of trailer ID's associated with the driver for the day.",
- "type": "object",
- "format": "int64",
- "example": [
- 10293,
- 192933
- ]
- },
- "vehicleIds": {
- "description": "List of vehicle ID's associated with the driver for the day.",
- "type": "object",
- "format": "int64",
- "example": [
- 192319,
- 12958
- ]
- }
- }
- }
- }
- }
- },
- "DriverForCreate": {
- "allOf": [
- {
- "type": "object",
- "required": [
- "password"
- ],
- "properties": {
- "password": {
- "description": "Driver's password for the driver app.",
- "type": "string",
- "example": "mypassword"
- },
- "tagIds": {
- "$ref": "#/definitions/TagIds"
- }
- }
- },
- {
- "$ref": "#/definitions/DriverBase"
- }
- ]
- },
- "DriverForUpdate": {
- "allOf": [
- {
- "type": "object",
- "properties": {
- "tagIds": {
- "$ref": "#/definitions/TagIds"
- }
- }
- },
- {
- "$ref": "#/definitions/DriverBase"
- }
- ]
- },
- "DriverSafetyScoreResponse": {
- "description": "Safety score details for a driver",
- "type": "object",
- "properties": {
- "crashCount": {
- "description": "Crash event count",
- "type": "integer",
- "example": 0
- },
- "driverId": {
- "description": "Driver ID",
- "type": "integer",
- "example": 1234
- },
- "harshAccelCount": {
- "description": "Harsh acceleration event count",
- "type": "integer",
- "example": 1
- },
- "harshBrakingCount": {
- "description": "Harsh braking event count",
- "type": "integer",
- "example": 2
- },
- "harshEvents": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/SafetyReportHarshEvent"
- }
- },
- "harshTurningCount": {
- "description": "Harsh turning event count",
- "type": "integer",
- "example": 0
- },
- "safetyScore": {
- "description": "Safety Score",
- "type": "integer",
- "example": 97
- },
- "safetyScoreRank": {
- "description": "Safety Score Rank",
- "type": "string",
- "example": "26"
- },
- "timeOverSpeedLimitMs": {
- "description": "Amount of time driven over the speed limit in milliseconds",
- "type": "integer",
- "example": 3769
- },
- "totalDistanceDrivenMeters": {
- "description": "Total distance driven in meters",
- "type": "integer",
- "example": 291836
- },
- "totalHarshEventCount": {
- "description": "Total harsh event count",
- "type": "integer",
- "example": 3
- },
- "totalTimeDrivenMs": {
- "description": "Amount of time driven in milliseconds",
- "type": "integer",
- "example": 19708293
- }
- }
- },
- "DriversResponse": {
- "type": "object",
- "properties": {
- "drivers": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Driver"
- }
- }
- }
- },
- "DriversSummaryResponse": {
- "type": "object",
- "properties": {
- "Summaries": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "activeMs": {
- "description": "Duration in milliseconds that driver was on duty or driving during the requested time range",
- "type": "number",
- "format": "int64",
- "example": 43200000
- },
- "distanceMiles": {
- "description": "Distance driven in miles, rounded to two decimal places.",
- "type": "number",
- "format": "double",
- "example": 123.24
- },
- "driveMs": {
- "description": "Duration in milliseconds that driver was driving during the requested time range",
- "type": "number",
- "format": "int64",
- "example": 21600000
- },
- "driverId": {
- "description": "ID of the driver.",
- "type": "integer",
- "format": "int64",
- "example": 444
- },
- "driverName": {
- "description": "Name of the driver.",
- "type": "string",
- "example": "Fred Jacobs"
- },
- "driverUsername": {
- "description": "Username of the driver.",
- "type": "string",
- "example": "fjacobs"
- },
- "groupId": {
- "description": "Group of the driver.",
- "type": "integer",
- "format": "int64",
- "example": 111
- },
- "onDutyMs": {
- "description": "Duration in milliseconds that driver was on duty during the requested time range",
- "type": "number",
- "format": "int64",
- "example": 21600000
- }
- }
- }
- }
- }
- },
- "DvirBase": {
- "type": "object",
- "properties": {
- "authorSignature": {
- "description": "The authors signature for the DVIR.",
- "type": "object",
- "properties": {
- "driverId": {
- "description": "ID of the driver who signed the DVIR. Will not be returned if mechanicUserId is returned.",
- "type": "integer",
- "format": "int64",
- "example": 2581
- },
- "email": {
- "description": "Email of the driver|mechanic who signed the DVIR.",
- "type": "string",
- "example": "j.smith@yahoo.com"
- },
- "mechanicUserId": {
- "description": "ID of the mechanic who signed the DVIR. Will not be returned if driverId is returned.",
- "type": "integer",
- "format": "int64",
- "example": 14849
- },
- "name": {
- "description": "The name of the driver or mechanic who signed the DVIR.",
- "type": "string",
- "example": "John Smith"
- },
- "signedAt": {
- "description": "The time in millis when the DVIR was signed",
- "type": "integer",
- "format": "int64",
- "example": 12535500000
- },
- "type": {
- "description": "Type corresponds to whether the signature corresponds to driver|mechanic.",
- "type": "string",
- "example": "driver"
- },
- "username": {
- "description": "Username of the driver|mechanic who signed the DVIR.",
- "type": "string",
- "example": "jsmith"
- }
- }
- },
- "defectsCorrected": {
- "description": "Signifies if the defects on the vehicle corrected after the DVIR is done.",
- "type": "boolean",
- "example": true
- },
- "defectsNeedNotBeCorrected": {
- "description": "Signifies if the defects on this vehicle can be ignored.",
- "type": "boolean",
- "example": false
- },
- "id": {
- "description": "The id of this DVIR record.",
- "type": "integer",
- "format": "int64",
- "example": 19
- },
- "inspectionType": {
- "description": "Inspection type of the DVIR.",
- "type": "string",
- "example": "pre trip"
- },
- "mechanicNotes": {
- "description": "The mechanics notes on the DVIR.",
- "type": "string",
- "example": "The vehicle is now safe."
- },
- "mechanicOrAgentSignature": {
- "description": "The mechanic's or agent's signature for the DVIR.",
- "type": "object",
- "properties": {
- "driverId": {
- "description": "ID of the driver who signed the DVIR. Will not be returned if mechanicUserId is returned.",
- "type": "integer",
- "format": "int64",
- "example": 2581
- },
- "email": {
- "description": "Email of the agent|mechanic who signed the DVIR.",
- "type": "string",
- "example": "j.smith@yahoo.com"
- },
- "mechanicUserId": {
- "description": "ID of the mechanic who signed the DVIR. Will not be returned if driverId is returned.",
- "type": "integer",
- "format": "int64",
- "example": 14849
- },
- "name": {
- "description": "The name of the agent or mechanic who signed the DVIR.",
- "type": "string",
- "example": "John Smith"
- },
- "signedAt": {
- "description": "The time in millis when the DVIR was signed",
- "type": "integer",
- "format": "int64",
- "example": 12535500000
- },
- "type": {
- "description": "Type corresponds to whether the signature corresponds to driver|mechanic.",
- "type": "string",
- "example": "driver"
- },
- "username": {
- "description": "Username of the agent|mechanic who signed the DVIR.",
- "type": "string",
- "example": "jsmith"
- }
- }
- },
- "nextDriverSignature": {
- "description": "The next driver signature for the DVIR.",
- "type": "object",
- "properties": {
- "driverId": {
- "description": "ID of the driver who signed the DVIR",
- "type": "integer",
- "format": "int64",
- "example": 2581
- },
- "email": {
- "description": "Email of the driver who signed the next DVIR on this vehicle.",
- "type": "string",
- "example": "j.smith@yahoo.com"
- },
- "name": {
- "description": "The name of the driver who signed the next DVIR on this vehicle.",
- "type": "string",
- "example": "John Smith"
- },
- "signedAt": {
- "description": "The time in millis when the next driver signed the DVIR on this vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 12535500000
- },
- "type": {
- "description": "Type corresponds to driver.",
- "type": "string",
- "example": "driver"
- },
- "username": {
- "description": "Username of the driver who signed the next DVIR on this vehicle.",
- "type": "string",
- "example": "jsmith"
- }
- }
- },
- "odometerMiles": {
- "description": "The odometer reading in miles for the vehicle when the DVIR was done.",
- "type": "integer",
- "format": "int64",
- "example": 49912
- },
- "timeMs": {
- "description": "Timestamp of this DVIR in UNIX milliseconds.",
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- },
- "trailerDefects": {
- "description": "Defects registered for the trailer which was part of the DVIR.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "comment": {
- "description": "The comment describing the type of DVIR defect",
- "type": "string",
- "example": "Air Compressor not working"
- },
- "defectType": {
- "description": "The type of DVIR defect",
- "type": "string",
- "example": "Air Compressor"
- }
- }
- }
- },
- "trailerId": {
- "description": "The id of the trailer which was part of the DVIR.",
- "type": "integer",
- "example": 19
- },
- "trailerName": {
- "description": "The name of the trailer which was part of the DVIR.",
- "type": "string",
- "example": "Storer's Trailer 19"
- },
- "vehicle": {
- "description": "The vehicle on which DVIR was done.",
- "type": "object",
- "properties": {
- "id": {
- "description": "The vehicle id on which DVIR was done.",
- "type": "integer",
- "format": "int64",
- "example": 19
- },
- "name": {
- "description": "The vehicle on which DVIR was done.",
- "type": "string",
- "example": "Storer's vehicle 19"
- }
- }
- },
- "vehicleCondition": {
- "description": "The condition of vechile on which DVIR was done.",
- "type": "string",
- "example": "SATISFACTORY"
- },
- "vehicleDefects": {
- "description": "Defects registered for the vehicle which was part of the DVIR.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "comment": {
- "description": "The comment describing the type of DVIR defect",
- "type": "string",
- "example": "Air Compressor not working"
- },
- "defectType": {
- "description": "The type of DVIR defect",
- "type": "string",
- "example": "Air Compressor"
- }
- }
- }
- }
- }
- },
- "DvirListResponse": {
- "type": "object",
- "properties": {
- "dvirs": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/DvirBase"
- }
- }
- }
- },
- "EngineState": {
- "description": "The state of the vehicle over time. State can be Running, Off, or Idle.",
- "type": "object",
- "required": [
- "timeMs",
- "value"
- ],
- "properties": {
- "timeMs": {
- "description": "Timestamp in Unix epoch milliseconds.",
- "type": "number",
- "format": "int64",
- "example": 1546542978484
- },
- "value": {
- "type": "string",
- "enum": [
- "Running",
- "Off",
- "Idle"
- ]
- }
- }
- },
- "ErrorResponse": {
- "description": "Error message describing why the request failed.",
- "type": "string"
- },
- "FleetVehicleLocation": {
- "description": "Contains the location and speed of a vehicle at a particular time",
- "type": "object",
- "properties": {
- "latitude": {
- "description": "The latitude of the location in degrees.",
- "type": "number",
- "format": "double",
- "example": 37.2
- },
- "location": {
- "description": "The best effort (street,city,state) for the latitude and longitude.",
- "type": "string",
- "example": "525 York, San Francisco, CA"
- },
- "longitude": {
- "description": "The longitude of the location in degrees.",
- "type": "number",
- "format": "double",
- "example": -122.5
- },
- "speedMilesPerHour": {
- "description": "The speed calculated from GPS that the asset was traveling at in miles per hour.",
- "type": "number",
- "format": "double",
- "example": 35.2
- },
- "timeMs": {
- "description": "Time in Unix milliseconds since epoch when the asset was at the location.",
- "type": "number",
- "format": "int64",
- "example": 1535586471332
- }
- }
- },
- "FleetVehicleLocations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/FleetVehicleLocation"
- }
- },
- "FleetVehicleResponse": {
- "description": "A vehicle object as returned for fleet/vehicle",
- "type": "object",
- "required": [
- "id",
- "name"
- ],
- "properties": {
- "externalIds": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- },
- "example": {
- "maintenanceId": "ABFS18600"
- }
- },
- "harshAccelSetting": {
- "description": "Harsh event detection setting.",
- "type": "string",
- "example": "Heavy"
- },
- "id": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- },
- "name": {
- "description": "Name of the vehicle.",
- "type": "string",
- "example": "Truck A7"
- },
- "vehicleInfo": {
- "type": "object",
- "properties": {
- "make": {
- "description": "Make of the vehicle.",
- "type": "string",
- "example": "Honda"
- },
- "model": {
- "description": "Model of the Vehicle.",
- "type": "string",
- "example": "Odyssey"
- },
- "vin": {
- "description": "Vehicle Identification Number.",
- "type": "string",
- "example": "1FUJA6BD31LJ09646"
- },
- "year": {
- "description": "Year of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 1997
- }
- }
- }
- }
- },
- "FleetVehiclesLocations": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- },
- "locations": {
- "$ref": "#/definitions/FleetVehicleLocations"
- },
- "name": {
- "description": "Name of the vehicle.",
- "type": "string",
- "example": "Truck A7"
- }
- }
- }
- },
- "HosAuthenticationLogsResponse": {
- "type": "object",
- "properties": {
- "authenticationLogs": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "actionType": {
- "description": "The log type - one of 'signin' or 'signout'",
- "type": "string",
- "example": "signin"
- },
- "address": {
- "description": "Address at which the log was recorded, if applicable.",
- "type": "string",
- "example": "123 Main St., Ahwatukee, Arizona 85044"
- },
- "addressName": {
- "description": "Address name from the group address book at which the log was recorded, if applicable.",
- "type": "string",
- "example": "Garage Number 3"
- },
- "city": {
- "description": "City in which the log was recorded, if applicable.",
- "type": "string",
- "example": "Ahwatukee"
- },
- "happenedAtMs": {
- "description": "The time at which the event was recorded in UNIX milliseconds.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "state": {
- "description": "State in which the log was recorded, if applicable.",
- "type": "string",
- "example": "Arizona"
- }
- }
- }
- }
- }
- },
- "HosLogsResponse": {
- "type": "object",
- "properties": {
- "logs": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "codriverIds": {
- "type": "array",
- "items": {
- "description": "Ids of codrivers during any of the logged trips",
- "type": "number",
- "example": 445
- }
- },
- "driverId": {
- "description": "ID of the driver.",
- "type": "integer",
- "format": "int64",
- "example": 444
- },
- "groupId": {
- "description": "ID of the group.",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "locCity": {
- "description": "City in which the log was recorded.",
- "type": "string",
- "example": "Ahwatukee"
- },
- "locLat": {
- "description": "Latitude at which the log was recorded.",
- "type": "number",
- "format": "float",
- "example": 23.413702345
- },
- "locLng": {
- "description": "Longitude at which the log was recorded.",
- "type": "number",
- "format": "float",
- "example": -98.502888123
- },
- "locName": {
- "description": "Name of location at which the log was recorded.",
- "type": "string",
- "example": "McLean Site A"
- },
- "locState": {
- "description": "State in which the log was recorded.",
- "type": "string",
- "example": "Arizona"
- },
- "logStartMs": {
- "description": "The time at which the log/HOS status started in UNIX milliseconds.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "remark": {
- "description": "Remark associated with the log entry.",
- "type": "string",
- "example": "Lunch Break"
- },
- "statusType": {
- "description": "The Hours of Service status type. One of `OFF_DUTY`, `SLEEPER_BED`, `DRIVING`, `ON_DUTY`, `YARD_MOVE`, `PERSONAL_CONVEYANCE`.",
- "type": "string",
- "example": "OFF_DUTY"
- },
- "vehicleId": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- }
- }
- }
- }
- }
- },
- "HosLogsSummaryResponse": {
- "type": "object",
- "properties": {
- "drivers": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "cycleRemaining": {
- "description": "The amount of remaining cycle time (in ms).",
- "type": "integer",
- "format": "int64",
- "example": 252000000
- },
- "cycleTomorrow": {
- "description": "The amount of cycle time (in ms) available tomorrow.",
- "type": "integer",
- "format": "int64",
- "example": 252000000
- },
- "driverId": {
- "description": "ID of the driver.",
- "type": "integer",
- "format": "int64",
- "example": 444
- },
- "driverName": {
- "description": "Name of the driver.",
- "type": "string",
- "example": "Fred Jacobs"
- },
- "drivingInViolationCycle": {
- "description": "The amount of driving time in violation in this cycle (in ms).",
- "type": "integer",
- "format": "int64",
- "example": 50400000
- },
- "drivingInViolationToday": {
- "description": "The amount of driving time in violation today (in ms).",
- "type": "integer",
- "format": "int64",
- "example": 39600000
- },
- "dutyStatus": {
- "description": "The Hours of Service status type. One of `OFF_DUTY`, `SLEEPER_BED`, `DRIVING`, `ON_DUTY`, `YARD_MOVE`, `PERSONAL_CONVEYANCE`.",
- "type": "string",
- "example": "OFF_DUTY"
- },
- "shiftDriveRemaining": {
- "description": "The amount of remaining shift drive time (in ms).",
- "type": "integer",
- "format": "int64",
- "example": 39600000
- },
- "shiftRemaining": {
- "description": "The amount of remaining shift time (in ms).",
- "type": "integer",
- "format": "int64",
- "example": 50400000
- },
- "timeInCurrentStatus": {
- "description": "The amount of time (in ms) that the driver has been in the current `dutyStatus`.",
- "type": "integer",
- "format": "int64",
- "example": 5000
- },
- "timeUntilBreak": {
- "description": "The amount of time (in ms) remaining until the driver cannot drive without a rest break.",
- "type": "integer",
- "format": "int64",
- "example": 28800000
- },
- "vehicleName": {
- "description": "Name of the vehicle.",
- "type": "string",
- "example": "Vehicle 1"
- }
- }
- }
- }
- }
- },
- "HumidityResponse": {
- "description": "Contains the current humidity of a sensor.",
- "type": "object",
- "properties": {
- "groupId": {
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "sensors": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "humidity": {
- "description": "Currently reported relative humidity in percent, from 0-100.",
- "type": "integer",
- "example": 53
- },
- "id": {
- "description": "ID of the sensor.",
- "type": "integer",
- "format": "int64",
- "example": 122
- },
- "name": {
- "description": "Name of the sensor.",
- "type": "string",
- "example": "Freezer Humidity Sensor"
- }
- }
- }
- }
- }
- },
- "Machine": {
- "description": "Contains information about a machine.",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "ID of the machine.",
- "type": "integer",
- "format": "int64",
- "example": 123
- },
- "name": {
- "description": "Name of the machine.",
- "type": "string",
- "example": "Freezer ABC"
- },
- "notes": {
- "description": "Notes about the machine",
- "type": "string",
- "example": "This is in the left hallway behind the conveyor belt"
- }
- }
- },
- "MachineHistoryResponse": {
- "description": "Contains the results for a machine history request",
- "type": "object",
- "properties": {
- "machines": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "description": "Machine ID",
- "type": "integer",
- "example": 1
- },
- "name": {
- "description": "Machine name",
- "type": "string",
- "example": "1/3 HP Motor"
- },
- "vibrations": {
- "description": "List of vibration datapoints, with timestamp and vibration measurement for x/y/z axis in mm/s",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "X": {
- "type": "number",
- "format": "double",
- "example": 0.01
- },
- "Y": {
- "type": "number",
- "format": "double",
- "example": 1.23
- },
- "Z": {
- "type": "number",
- "format": "double",
- "example": 2.55
- },
- "time": {
- "type": "integer",
- "format": "int64",
- "example": 1453449599999
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "Message": {
- "type": "object",
- "required": [
- "driverId",
- "text"
- ],
- "properties": {
- "driverId": {
- "description": "ID of the driver for whom the message is sent to or sent by.",
- "type": "integer",
- "format": "int64",
- "example": 555
- },
- "text": {
- "description": "The text sent in the message.",
- "type": "string",
- "example": "This is a message."
- }
- }
- },
- "MessageResponse": {
- "type": "object",
- "required": [
- "driverId",
- "text",
- "sentAtMs",
- "sender",
- "isRead"
- ],
- "properties": {
- "driverId": {
- "description": "ID of the driver for whom the message is sent to or sent by.",
- "type": "integer",
- "format": "int64",
- "example": 555
- },
- "isRead": {
- "description": "True if the message was read by the recipient.",
- "type": "boolean",
- "example": true
- },
- "sender": {
- "$ref": "#/definitions/MessageSender"
- },
- "sentAtMs": {
- "description": "The time in Unix epoch milliseconds that the message is sent to the recipient.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "text": {
- "description": "The text sent in the message.",
- "type": "string",
- "example": "This is a message."
- }
- }
- },
- "MessageSender": {
- "type": "object",
- "required": [
- "type",
- "name"
- ],
- "properties": {
- "name": {
- "description": "Name of user that is sending the message.",
- "type": "string",
- "example": "John Doe"
- },
- "type": {
- "description": "Type of user that is sending the message. It will be either dispatch or driver.",
- "type": "string",
- "example": "dispatch"
- }
- }
- },
- "Messages": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Message"
- }
- },
- "MessagesResponse": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/MessageResponse"
- }
- },
- "Pagination": {
- "type": "object",
- "required": [
- "hasNextPage",
- "hasPrevPage",
- "startCursor",
- "endCursor"
- ],
- "properties": {
- "endCursor": {
- "description": "Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'starting_after' query parameter.",
- "type": "string",
- "example": "MTU5MTEzNjA2OTU0MzQ3"
- },
- "hasNextPage": {
- "description": "True if there are more pages of results after this response.",
- "type": "boolean"
- },
- "hasPrevPage": {
- "description": "True if there are more pages of results before this response.",
- "type": "boolean"
- },
- "startCursor": {
- "description": "Cursor identifier representing the first element in the response. This value should be used in conjunction with a subsequent request's 'ending_before' query parameter.",
- "type": "string",
- "example": "MTU5MTEzNjA2OTU0MzQ3"
- }
- }
- },
- "ProgramsForTheCameraResponse": {
- "description": "Contains the list of Programs configured on the given Camera.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "programId": {
- "type": "integer",
- "format": "int64",
- "example": 1
- },
- "programName": {
- "type": "string",
- "example": "Barcode verification program"
- }
- }
- }
- },
- "SafetyReportHarshEvent": {
- "description": "List of harsh events",
- "type": "object",
- "properties": {
- "harshEventType": {
- "description": "Type of the harsh event",
- "type": "string",
- "example": "Harsh Braking"
- },
- "timestampMs": {
- "description": "Timestamp that the harsh event occurred in Unix milliseconds since epoch",
- "type": "integer",
- "example": 1535590776000
- },
- "vehicleId": {
- "description": "Vehicle associated with the harsh event",
- "type": "integer",
- "example": 212014918086169
- }
- }
- },
- "Sensor": {
- "description": "Contains information about a sensor.",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "ID of the sensor.",
- "type": "integer",
- "format": "int64",
- "example": 123
- },
- "macAddress": {
- "description": "MAC address of the sensor.",
- "type": "string",
- "example": "11:11:11:11:11:11"
- },
- "name": {
- "description": "Name of the sensor.",
- "type": "string",
- "example": "Freezer ABC"
- }
- }
- },
- "SensorHistoryResponse": {
- "description": "Contains the results for a sensor history request. Each result contains a timestamp and datapoint for each requested (sensor, field) pair.",
- "type": "object",
- "properties": {
- "results": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "series": {
- "description": "List of datapoints, one for each requested (sensor, field) pair.",
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int64",
- "example": 1
- }
- },
- "timeMs": {
- "description": "Timestamp in UNIX milliseconds.",
- "type": "integer",
- "example": 1453449599999
- }
- }
- }
- }
- }
- },
- "Tag": {
- "type": "object",
- "required": [
- "id",
- "name"
- ],
- "properties": {
- "addresses": {
- "description": "The addresses that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedAddress"
- }
- },
- "assets": {
- "description": "The assets that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedAsset"
- }
- },
- "drivers": {
- "description": "The drivers that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedDriver"
- }
- },
- "groupId": {
- "description": "The GroupID that this tag belongs to.",
- "type": "integer",
- "format": "int64",
- "example": 2348
- },
- "id": {
- "description": "The ID of this tag.",
- "type": "integer",
- "format": "int64",
- "example": 12345
- },
- "machines": {
- "description": "The machines that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedMachine"
- }
- },
- "name": {
- "description": "Name of this tag.",
- "type": "string",
- "example": "Broken Vehicles"
- },
- "parentTagId": {
- "description": "If this tag is part a hierarchical tag tree as a child tag, the parentTagId is the ID of this tag's parent tag.",
- "type": "integer",
- "format": "int64",
- "example": 8389
- },
- "sensors": {
- "description": "The sensors that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedSensor"
- }
- },
- "vehicles": {
- "description": "The vehicles that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedVehicle"
- }
- }
- }
- },
- "TagCreate": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "assets": {
- "description": "The assets that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedAssetBase"
- }
- },
- "drivers": {
- "description": "The drivers that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedDriverBase"
- }
- },
- "machines": {
- "description": "The machines that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedMachineBase"
- }
- },
- "name": {
- "description": "Name of this tag.",
- "type": "string",
- "example": "Broken Vehicles"
- },
- "parentTagId": {
- "description": "If this tag is part a hierarchical tag tree as a child tag, the parentTagId is the ID of this tag's parent tag.",
- "type": "integer",
- "format": "int64",
- "example": 8389
- },
- "sensors": {
- "description": "The sensors that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedSensorBase"
- }
- },
- "vehicles": {
- "description": "The vehicles that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedVehicleBase"
- }
- }
- }
- },
- "TagIds": {
- "description": "A list of tag IDs.",
- "type": "array",
- "items": {
- "type": "number",
- "format": "int64",
- "example": 123
- }
- },
- "TagMetadata": {
- "type": "object",
- "required": [
- "id",
- "name"
- ],
- "properties": {
- "id": {
- "description": "The ID of this tag.",
- "type": "integer",
- "format": "int64",
- "example": 12345
- },
- "name": {
- "description": "Name of this tag.",
- "type": "string",
- "example": "Broken Vehicles"
- }
- }
- },
- "TagModify": {
- "type": "object",
- "properties": {
- "add": {
- "description": "Specify devices, etc. that should be added to the tag.",
- "type": "object",
- "properties": {
- "assets": {
- "description": "The assets to be added to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedAssetBase"
- }
- },
- "drivers": {
- "description": "The drivers to be added to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedDriverBase"
- }
- },
- "machines": {
- "description": "The machines to be added to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedMachineBase"
- }
- },
- "sensors": {
- "description": "The sensors to be added to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedSensorBase"
- }
- },
- "vehicles": {
- "description": "The vehicles to be added to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedVehicleBase"
- }
- }
- }
- },
- "delete": {
- "description": "Specify devices, etc. that should be removed from the tag.",
- "type": "object",
- "properties": {
- "assets": {
- "description": "The assets to be removed from this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedAssetBase"
- }
- },
- "drivers": {
- "description": "The drivers to be removed from this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedDriverBase"
- }
- },
- "machines": {
- "description": "The machines to be removed from this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedMachineBase"
- }
- },
- "sensors": {
- "description": "The sensors to be removed from this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedSensorBase"
- }
- },
- "vehicles": {
- "description": "The vehicles to be removed from this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedVehicleBase"
- }
- }
- }
- },
- "name": {
- "description": "Updated name of this tag.",
- "type": "string",
- "example": "Broken Vehicles"
- },
- "parentTagId": {
- "description": "If this tag is part a hierarchical tag tree as a child tag, the parentTagId is the ID of this tag's parent tag.",
- "type": "integer",
- "format": "int64",
- "example": 8389
- }
- }
- },
- "TagUpdate": {
- "type": "object",
- "properties": {
- "assets": {
- "description": "The assets that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedAssetBase"
- }
- },
- "drivers": {
- "description": "The drivers that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedDriverBase"
- }
- },
- "machines": {
- "description": "The machines that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedMachineBase"
- }
- },
- "name": {
- "description": "Updated name of this tag.",
- "type": "string",
- "example": "Broken Vehicles"
- },
- "parentTagId": {
- "description": "If this tag is part a hierarchical tag tree as a child tag, the parentTagId is the ID of this tag's parent tag.",
- "type": "integer",
- "format": "int64",
- "example": 8389
- },
- "sensors": {
- "description": "The sensors that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedSensorBase"
- }
- },
- "vehicles": {
- "description": "The vehicles that belong to this tag.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/TaggedVehicleBase"
- }
- }
- }
- },
- "TaggedAddress": {
- "allOf": [
- {
- "$ref": "#/definitions/TaggedAddressBase"
- },
- {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the address being tagged.",
- "type": "string",
- "example": "Truck Lot 345"
- }
- }
- }
- ]
- },
- "TaggedAddressBase": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the address being tagged.",
- "type": "integer",
- "format": "int64",
- "example": 345
- }
- }
- },
- "TaggedAsset": {
- "allOf": [
- {
- "$ref": "#/definitions/TaggedAssetBase"
- },
- {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the Asset being tagged.",
- "type": "string",
- "example": "Trailer 789"
- }
- }
- }
- ]
- },
- "TaggedAssetBase": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the Asset being tagged.",
- "type": "integer",
- "format": "int64",
- "example": 789
- }
- }
- },
- "TaggedDriver": {
- "allOf": [
- {
- "$ref": "#/definitions/TaggedDriverBase"
- },
- {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the Driver being tagged.",
- "type": "string",
- "example": "John Smith"
- }
- }
- }
- ]
- },
- "TaggedDriverBase": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the Driver being tagged.",
- "type": "integer",
- "format": "int64",
- "example": 456
- }
- }
- },
- "TaggedMachine": {
- "allOf": [
- {
- "$ref": "#/definitions/TaggedMachineBase"
- },
- {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the Machine being tagged.",
- "type": "string",
- "example": "Vibration Monitor 567"
- }
- }
- }
- ]
- },
- "TaggedMachineBase": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the Machine being tagged.",
- "type": "integer",
- "format": "int64",
- "example": 567
- }
- }
- },
- "TaggedSensor": {
- "allOf": [
- {
- "$ref": "#/definitions/TaggedSensorBase"
- },
- {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the Sensor being tagged.",
- "type": "string",
- "example": "Temperature Sensor 345"
- }
- }
- }
- ]
- },
- "TaggedSensorBase": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the Sensor being tagged.",
- "type": "integer",
- "format": "int64",
- "example": 345
- }
- }
- },
- "TaggedVehicle": {
- "allOf": [
- {
- "$ref": "#/definitions/TaggedVehicleBase"
- },
- {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the Vehicle being tagged.",
- "type": "string",
- "example": "Heavy Duty 123"
- }
- }
- }
- ]
- },
- "TaggedVehicleBase": {
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "The ID of the Vehicle being tagged.",
- "type": "integer",
- "format": "int64",
- "example": 123
- }
- }
- },
- "TemperatureResponse": {
- "description": "Contains the current temperatures of a sensor.",
- "type": "object",
- "properties": {
- "groupId": {
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "sensors": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "ambientTemperature": {
- "description": "Currently reported ambient temperature in millidegrees celsius.",
- "type": "integer",
- "example": 11057
- },
- "id": {
- "description": "ID of the sensor.",
- "type": "integer",
- "format": "int64",
- "example": 122
- },
- "name": {
- "description": "Name of the sensor.",
- "type": "string",
- "example": "Freezer Temp Sensor"
- },
- "probeTemperature": {
- "description": "Currently reported probe temperature in millidegrees celsius. If no probe is connected, this parameter will not be reported.",
- "type": "integer",
- "example": -20145
- }
- }
- }
- }
- }
- },
- "TrailerAssignmentResponse": {
- "type": "object",
- "properties": {
- "driverId": {
- "description": "The ID of the driver associated with this trailer.",
- "type": "integer",
- "format": "int64",
- "example": 2047
- },
- "endMs": {
- "description": "The time at which the driver ended the assignment. If the assignment is current, this value will be omitted.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "startMs": {
- "description": "The time at which the driver started the assignment",
- "type": "integer",
- "format": "int64",
- "example": 1462878398034
- }
- }
- },
- "TrailerAssignmentsResponse": {
- "allOf": [
- {
- "$ref": "#/definitions/TrailerBase"
- },
- {
- "type": "object",
- "properties": {
- "trailerAssignments": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TrailerAssignmentResponse"
- }
- }
- }
- }
- ]
- },
- "TrailerBase": {
- "type": "object",
- "required": [
- "id",
- "name"
- ],
- "properties": {
- "id": {
- "description": "ID of the trailer",
- "type": "integer",
- "format": "int64",
- "example": 2041
- },
- "name": {
- "description": "Assignment trailer name (given when creating trailer via the trailer portal)",
- "type": "string",
- "format": "string",
- "example": "myTrailer"
- }
- }
- },
- "TripResponse": {
- "description": "Contains the trips for the vehicle in the requested timeframe. A trip is represented as an object that contains startMs, startLocation, startAddress, startCoordinates, endMs, endLocation, endAddress and endCoordinates.",
- "type": "object",
- "properties": {
- "trips": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "codriverIds": {
- "description": "List of codriver IDs",
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int64"
- },
- "example": [
- 122
- ]
- },
- "distanceMeters": {
- "description": "Length of the trip in meters.",
- "type": "integer",
- "example": 2500
- },
- "driverId": {
- "description": "ID of the driver.",
- "type": "integer",
- "example": 719
- },
- "endAddress": {
- "description": "Text representation of nearest identifiable location to the end (latitude, longitude) coordinates.",
- "type": "string",
- "example": "Winchell's Donuts House"
- },
- "endCoordinates": {
- "description": "End (latitude, longitude) in decimal degrees.",
- "type": "object",
- "properties": {
- "latitude": {
- "type": "number",
- "format": "double",
- "example": 23.413702345
- },
- "longitude": {
- "type": "number",
- "format": "double",
- "example": -91.502888123
- }
- }
- },
- "endLocation": {
- "description": "Geocoded street address of start (latitude, longitude) coordinates.",
- "type": "string",
- "example": "571 S Lake Ave, Pasadena, CA 91101"
- },
- "endMs": {
- "description": "End of the trip in UNIX milliseconds.",
- "type": "integer",
- "example": 1462881998034
- },
- "endOdometer": {
- "description": "Odometer reading (in meters) at the end of the trip.",
- "type": "integer",
- "example": 210430500
- },
- "fuelConsumedMl": {
- "description": "Amount in milliliters of fuel consumed on this trip.",
- "type": "integer",
- "example": 75700
- },
- "startAddress": {
- "description": "Text representation of nearest identifiable location to the start (latitude, longitude) coordinates.",
- "type": "string",
- "example": "Ramen Tatsunoya"
- },
- "startCoordinates": {
- "description": "Start (latitude, longitude) in decimal degrees.",
- "type": "object",
- "properties": {
- "latitude": {
- "type": "number",
- "format": "double",
- "example": 29.443702345
- },
- "longitude": {
- "type": "number",
- "format": "double",
- "example": -98.502888123
- }
- }
- },
- "startLocation": {
- "description": "Geocoded street address of start (latitude, longitude) coordinates.",
- "type": "string",
- "example": "16 N Fair Oaks Ave, Pasadena, CA 91103"
- },
- "startMs": {
- "description": "Beginning of the trip in UNIX milliseconds.",
- "type": "integer",
- "example": 1462878398034
- },
- "startOdometer": {
- "description": "Odometer reading (in meters) at the beginning of the trip.",
- "type": "integer",
- "example": 210430450
- },
- "tollMeters": {
- "description": "Length in meters trip spent on toll roads.",
- "type": "integer",
- "example": 32000
- }
- }
- }
- }
- }
- },
- "UpsertUserBase": {
- "type": "object",
- "properties": {
- "authType": {
- "description": "The authentication type the user uses to authenticate. To use SAML this organization must have a configured SAML integration.",
- "type": "string",
- "enum": [
- "default",
- "saml"
- ]
- },
- "name": {
- "description": "The first and last name of the user.",
- "type": "string",
- "example": "Jane Doe"
- },
- "organizationRoleId": {
- "description": "The id of the role the user is assigned to at the organization level. This will be blank for users that only have access to specific tags.",
- "type": "string",
- "example": "23d4d8d3-dc10-4e7a-a183-69968751f23e"
- },
- "tagRoles": {
- "description": "If specified, the user will be an administrator for these tags. If left blank, the user has access to the entire organization.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "roleId": {
- "description": "The id of the role",
- "type": "string",
- "example": "8a9371af-82d1-4158-bf91-4ecc8d3a114c"
- },
- "tagId": {
- "description": "The id of the tag to grant this user access to.",
- "type": "number",
- "format": "int64",
- "example": "123"
- }
- }
- }
- }
- }
- },
- "User": {
- "allOf": [
- {
- "$ref": "#/definitions/UserBase"
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "description": "The ID of the User record.",
- "type": "integer",
- "format": "int64",
- "example": 123
- },
- "organizationRole": {
- "description": "The name of the role the user is assigned to at the organization level. This will be blank for users that only have access to specific tags.",
- "type": "string",
- "example": "Full Admin"
- },
- "tagRoles": {
- "description": "The specific tags this user has access to. This will be blank for users that have full access to the organization.",
- "type": "array",
- "items": {
- "$ref": "#/definitions/UserTagRole"
- }
- }
- }
- }
- ]
- },
- "UserBase": {
- "type": "object",
- "required": [
- "email",
- "authType"
- ],
- "properties": {
- "authType": {
- "description": "The authentication type the user uses to authenticate. To use SAML this organization must have a configured SAML integration.",
- "type": "string",
- "enum": [
- "default",
- "saml"
- ]
- },
- "email": {
- "description": "The email address of this user.",
- "type": "string",
- "example": "user@company.com"
- },
- "name": {
- "description": "The first and last name of the user.",
- "type": "string",
- "example": "Jane Doe"
- },
- "organizationRoleId": {
- "description": "The id of the role the user is assigned to at the organization level. This will be blank for users that only have access to specific tags.",
- "type": "string",
- "example": "23d4d8d3-dc10-4e7a-a183-69968751f23e"
- }
- }
- },
- "UserRole": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "example": "8a9371af-82d1-4158-bf91-4ecc8d3a114c"
- },
- "name": {
- "type": "string",
- "example": "Full Admin"
- }
- }
- },
- "UserTagRole": {
- "type": "object",
- "required": [
- "tag",
- "roleId"
- ],
- "properties": {
- "role": {
- "description": "The name of the role the user has been granted on this tag.",
- "type": "string",
- "example": "Full Admin"
- },
- "roleId": {
- "description": "The id of the role the user has been granted on this tag.",
- "type": "string",
- "example": "8a9371af-82d1-4158-bf91-4ecc8d3a114c"
- },
- "tag": {
- "type": "object",
- "required": [
- "id",
- "name"
- ],
- "properties": {
- "id": {
- "description": "The ID of this tag.",
- "type": "integer",
- "format": "int64",
- "example": 12345
- },
- "name": {
- "description": "Name of this tag.",
- "type": "string",
- "example": "North Carolina Distribution"
- },
- "parentTagId": {
- "description": "The ID of this tag.",
- "type": "integer",
- "format": "int64",
- "example": 12345
- }
- }
- }
- }
- },
- "Vehicle": {
- "description": "A vehicle object.",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "engineHours": {
- "description": "Total engine hours for the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 1500
- },
- "fuelLevelPercent": {
- "description": "The fuel level of the vehicle as a percentage. (0.0 to 1.0)",
- "type": "number",
- "format": "float64",
- "example": 0.3
- },
- "id": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- },
- "name": {
- "description": "Name of the vehicle.",
- "type": "string",
- "example": "Truck A7"
- },
- "note": {
- "type": "string",
- "example": "Red truck 2015 M16"
- },
- "odometerMeters": {
- "description": "The number of meters reported by the odometer.",
- "type": "integer",
- "format": "int64",
- "example": 60130000
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TagMetadata"
- },
- "x-omitempty": true
- },
- "vin": {
- "description": "Vehicle Identification Number.",
- "type": "string",
- "example": "1FUJA6BD31LJ09646"
- }
- }
- },
- "VehicleHarshEventResponse": {
- "description": "Harsh event details for a vehicle",
- "type": "object",
- "required": [
- "incidentReportUrl",
- "harshEventType"
- ],
- "properties": {
- "downloadForwardVideoUrl": {
- "description": "URL for downloading the forward facing video",
- "type": "string",
- "example": "https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-123456789.mp4?..."
- },
- "downloadInwardVideoUrl": {
- "description": "URL for downloading the inward facing video",
- "type": "string",
- "example": "https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-driver-123456789.mp4?..."
- },
- "downloadTrackedInwardVideoUrl": {
- "description": "URL for downloading the tracked inward facing video",
- "type": "string",
- "example": "https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-driver-123456789.tracked.mp4?..."
- },
- "harshEventType": {
- "description": "Type of the harsh event. One of: [Crash, Harsh Acceleration, Harsh Braking, Harsh Turn, ROP Engine, ROP Brake, YC Engine, YC Brake, Harsh Event]",
- "type": "string",
- "example": "Harsh Braking"
- },
- "incidentReportUrl": {
- "description": "URL of the associated incident report page",
- "type": "string",
- "example": "https://cloud.samsara.com/groups/1234/fleet/reports/safety/vehicle/212123456789012/incident/1539201882984"
- },
- "isDistracted": {
- "description": "Whether the driver was deemed distracted during this harsh event",
- "type": "boolean",
- "example": true
- },
- "location": {
- "type": "object",
- "properties": {
- "address": {
- "description": "Address of location where the harsh event occurred",
- "type": "string",
- "example": "350 Rhode Island St, San Francisco, CA"
- },
- "latitude": {
- "description": "Latitude of location where the harsh event occurred",
- "type": "string",
- "example": "33.07614328"
- },
- "longitude": {
- "description": "Longitude of location where the harsh event occurred",
- "type": "string",
- "example": "-96.14907287"
- }
- }
- }
- }
- },
- "VehicleLocation": {
- "description": "Contains the location, in latitude and longitude, of a vehicle.",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "driverId": {
- "description": "The ID of the driver currently assigned to this vehicle.",
- "type": "integer",
- "example": 1
- },
- "heading": {
- "description": "Heading in degrees.",
- "type": "number",
- "format": "double",
- "example": 246.42
- },
- "id": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- },
- "latitude": {
- "description": "Latitude in decimal degrees.",
- "type": "number",
- "format": "double",
- "example": 123.456
- },
- "location": {
- "description": "Text representation of nearest identifiable location to (latitude, longitude) coordinates.",
- "type": "string",
- "example": "1 Main St, Dallas, TX"
- },
- "longitude": {
- "description": "Longitude in decimal degrees.",
- "type": "number",
- "format": "double",
- "example": 32.897
- },
- "name": {
- "description": "Name of the vehicle.",
- "type": "string",
- "example": "Truck A7"
- },
- "odometerMeters": {
- "description": "The number of meters reported by the odometer.",
- "type": "integer",
- "format": "int64",
- "example": 71774705
- },
- "onTrip": {
- "description": "Whether or not a trip is currently in progress for this vehicle. More information available via /fleet/trips endpoint.",
- "type": "boolean",
- "example": true
- },
- "routeIds": {
- "description": "A list of currently active route IDs that the vehicle is in.",
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int64"
- },
- "example": [
- 2244514,
- 2311654
- ]
- },
- "speed": {
- "description": "Speed in miles per hour.",
- "type": "number",
- "format": "double",
- "example": 64.37
- },
- "time": {
- "description": "The time the reported location was logged, reported as a UNIX timestamp in milliseconds.",
- "type": "integer",
- "example": 1462881998034
- },
- "vin": {
- "description": "Vehicle Identification Number (VIN) of the vehicle.",
- "type": "string",
- "example": "JTNBB46KX73011966"
- }
- }
- },
- "VehicleMaintenance": {
- "description": "Contains any J1939/Passenger engine light warnings and engine faults.",
- "type": "object",
- "required": [
- "id"
- ],
- "properties": {
- "id": {
- "description": "ID of the vehicle.",
- "type": "integer",
- "format": "int64",
- "example": 112
- },
- "j1939": {
- "description": "J1939 based data. Null if no data is available.",
- "type": "object",
- "properties": {
- "checkEngineLight": {
- "description": "J1939 check engine lights.",
- "type": "object",
- "properties": {
- "emissionsIsOn": {
- "type": "boolean"
- },
- "protectIsOn": {
- "type": "boolean"
- },
- "stopIsOn": {
- "type": "boolean"
- },
- "warningIsOn": {
- "type": "boolean"
- }
- }
- },
- "diagnosticTroubleCodes": {
- "description": "J1939 DTCs.",
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "fmiId",
- "fmiText",
- "occurrenceCount",
- "spnDescription",
- "spnId",
- "txId"
- ],
- "properties": {
- "fmiId": {
- "type": "integer"
- },
- "fmiText": {
- "type": "string"
- },
- "occurrenceCount": {
- "type": "integer"
- },
- "spnDescription": {
- "type": "string"
- },
- "spnId": {
- "type": "integer"
- },
- "txId": {
- "type": "integer"
- }
- }
- }
- }
- }
- },
- "passenger": {
- "description": "Passenger vehicle data. Null if no data is available.",
- "type": "object",
- "properties": {
- "checkEngineLight": {
- "description": "Passenger vehicle check engine light.",
- "type": "object",
- "properties": {
- "isOn": {
- "type": "boolean"
- }
- }
- },
- "diagnosticTroubleCodes": {
- "description": "Passenger vehicle DTCs.",
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "dtcId",
- "dtcDescription",
- "dtcShortCode"
- ],
- "properties": {
- "dtcDescription": {
- "type": "string"
- },
- "dtcId": {
- "type": "integer"
- },
- "dtcShortCode": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- },
- "VehicleSafetyScoreResponse": {
- "description": "Safety score details for a vehicle",
- "type": "object",
- "properties": {
- "crashCount": {
- "description": "Crash event count",
- "type": "integer",
- "example": 0
- },
- "harshAccelCount": {
- "description": "Harsh acceleration event count",
- "type": "integer",
- "example": 1
- },
- "harshBrakingCount": {
- "description": "Harsh braking event count",
- "type": "integer",
- "example": 2
- },
- "harshEvents": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/SafetyReportHarshEvent"
- }
- },
- "harshTurningCount": {
- "description": "Harsh turning event count",
- "type": "integer",
- "example": 0
- },
- "safetyScore": {
- "description": "Safety Score",
- "type": "integer",
- "example": 97
- },
- "safetyScoreRank": {
- "description": "Safety Score Rank",
- "type": "string",
- "example": "26"
- },
- "timeOverSpeedLimitMs": {
- "description": "Amount of time driven over the speed limit in milliseconds",
- "type": "integer",
- "example": 3769
- },
- "totalDistanceDrivenMeters": {
- "description": "Total distance driven in meters",
- "type": "integer",
- "example": 291836
- },
- "totalHarshEventCount": {
- "description": "Total harsh event count",
- "type": "integer",
- "example": 3
- },
- "totalTimeDrivenMs": {
- "description": "Amount of time driven in milliseconds",
- "type": "integer",
- "example": 19708293
- },
- "vehicleId": {
- "description": "Vehicle ID",
- "type": "integer",
- "example": 4321
- }
- }
- },
- "VisionCamerasResponse": {
- "description": "Contains the list of Cameras installed in the org.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "cameraId": {
- "type": "integer",
- "format": "int64",
- "example": 1234512345999
- },
- "cameraName": {
- "type": "string",
- "example": "Line 32"
- },
- "ethernetIp": {
- "type": "string",
- "example": "10.1.2.34"
- },
- "wifiIp": {
- "type": "string",
- "example": "10.1.2.35"
- }
- }
- }
- },
- "VisionRunByCameraResponse": {
- "type": "object",
- "properties": {
- "cameraId": {
- "type": "integer",
- "format": "int64",
- "example": 1234512345123
- },
- "endedAtMs": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "inspectionResults": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "captureAtMs": {
- "type": "number",
- "format": "float64",
- "example": 1553811994730
- },
- "result": {
- "type": "string",
- "example": "PASS"
- }
- }
- }
- },
- "isOnging": {
- "type": "boolean",
- "example": true
- },
- "program": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64",
- "example": 1
- },
- "name": {
- "type": "string",
- "example": "Barcode verification program"
- }
- }
- },
- "runSummary": {
- "type": "object",
- "properties": {
- "itemsPerMinute": {
- "type": "number",
- "format": "float64",
- "example": 0.1
- },
- "noReadCount": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "rejectCount": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "successCount": {
- "type": "integer",
- "format": "int64",
- "example": 181
- }
- }
- },
- "startedAtMs": {
- "type": "integer",
- "format": "int64",
- "example": 1553808606097
- }
- }
- },
- "VisionRunsByCameraResponse": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "deviceId": {
- "type": "integer",
- "format": "int64",
- "example": 1234512345123
- },
- "endedAtMs": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "program": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64",
- "example": 1
- },
- "name": {
- "type": "string",
- "example": "Barcode verification program"
- }
- }
- },
- "reportMetadata": {
- "type": "object",
- "properties": {
- "itemsPerMinute": {
- "type": "number",
- "format": "float64",
- "example": 0.1
- },
- "noReadCount": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "rejectCount": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "successCount": {
- "type": "integer",
- "format": "int64",
- "example": 181
- }
- }
- },
- "startedAtMs": {
- "type": "integer",
- "format": "int64",
- "example": 1553808606097
- }
- }
- }
- },
- "VisionRunsResponse": {
- "type": "object",
- "properties": {
- "visionRuns": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "deviceId": {
- "type": "integer",
- "format": "int64",
- "example": 1234512345123
- },
- "endedAtMs": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "programId": {
- "type": "integer",
- "format": "int64",
- "example": 1
- },
- "reportMetadata": {
- "type": "object",
- "properties": {
- "failedScansCount": {
- "type": "integer",
- "format": "int64",
- "example": 0
- },
- "noReadScansCount": {
- "type": "integer",
- "format": "int64",
- "example": 181
- },
- "scanRate": {
- "type": "number",
- "format": "float64",
- "example": 0.1
- },
- "successfulScansCount": {
- "type": "integer",
- "format": "int64",
- "example": 181
- }
- }
- },
- "startedAtMs": {
- "type": "integer",
- "format": "int64",
- "example": 1553808606097
- }
- }
- }
- }
- }
- },
- "allRouteJobUpdates": {
- "type": "object",
- "properties": {
- "job_updates": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/jobUpdateObject"
- }
- },
- "sequence_id": {
- "description": "Sequence ID of the last update returned in the response",
- "type": "string",
- "example": "eyJpZCI6MywiY3JlYXRlZF9hdCI6MTQ5OTQyOTIyMDAwMn0="
- }
- }
- },
- "jobStatus": {
- "description": "The current state of the dispatch job.",
- "type": "string",
- "enum": [
- "JobState_Unassigned",
- "JobState_Scheduled",
- "JobState_EnRoute",
- "JobState_Arrived",
- "JobState_Completed",
- "JobState_Skipped"
- ],
- "example": "JobState_Arrived"
- },
- "jobUpdateObject": {
- "type": "object",
- "properties": {
- "changed_at_ms": {
- "description": "Timestamp that this event was updated, represented as Unix milliseconds since epoch.",
- "type": "integer",
- "format": "int64",
- "example": 1462881998034
- },
- "job_id": {
- "description": "ID of the Samsara job.",
- "type": "integer",
- "format": "int64",
- "example": 773
- },
- "job_state": {
- "$ref": "#/definitions/jobStatus"
- },
- "prev_job_state": {
- "$ref": "#/definitions/prevJobStatus"
- },
- "route": {
- "$ref": "#/definitions/DispatchRoute"
- },
- "route_id": {
- "description": "ID of the Samsara dispatch route.",
- "type": "integer",
- "format": "int64",
- "example": 556
- }
- }
- },
- "prevJobStatus": {
- "description": "The previous state of the dispatch job.",
- "type": "string",
- "enum": [
- "JobState_Unassigned",
- "JobState_Scheduled",
- "JobState_EnRoute",
- "JobState_Arrived",
- "JobState_Completed",
- "JobState_Skipped"
- ],
- "example": "JobState_EnRoute"
- }
- },
- "parameters": {
- "accessTokenParam": {
- "type": "string",
- "description": "Samsara API access token.",
- "name": "access_token",
- "in": "query",
- "required": true
- },
- "addContactParam": {
- "description": "Add a contact",
- "name": "contact",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/ContactInput"
- }
- },
- "addressAddParam": {
- "description": "List of addresses/geofences to add. Geofences can be circular or a polygon. \nFor each address, only one of 'circle' or 'polygon' should be provided. If both are provided, the geofence will be saved as a polygon.",
- "name": "addresses",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "addresses"
- ],
- "properties": {
- "addresses": {
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "name",
- "formattedAddress",
- "geofence"
- ],
- "properties": {
- "contactIds": {
- "$ref": "#/definitions/ContactIds"
- },
- "formattedAddress": {
- "description": "The full address associated with this address/geofence, as it might be recognized by maps.google.com",
- "type": "string",
- "example": "350 Rhode Island St, San Francisco, CA"
- },
- "geofence": {
- "$ref": "#/definitions/AddressGeofence"
- },
- "name": {
- "description": "The name of this address/geofence",
- "type": "string",
- "example": "Samsara HQ"
- },
- "notes": {
- "$ref": "#/definitions/AddressNotes"
- },
- "tagIds": {
- "$ref": "#/definitions/TagIds"
- }
- }
- }
- }
- }
- }
- },
- "addressUpdateParam": {
- "description": "Update parts of an address's value. If the geofence 'circle' or 'polygon' key is specified, the update will change the type of geofence accordingly.",
- "name": "address",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "contactIds": {
- "$ref": "#/definitions/ContactIds"
- },
- "formattedAddress": {
- "description": "The full address associated with this address/geofence, as it might be recognized by maps.google.com",
- "type": "string",
- "example": "350 Rhode Island St, San Francisco, CA"
- },
- "geofence": {
- "$ref": "#/definitions/AddressGeofence"
- },
- "name": {
- "description": "The name of this address/geofence",
- "type": "string",
- "example": "Samsara HQ"
- },
- "notes": {
- "$ref": "#/definitions/AddressNotes"
- },
- "tagIds": {
- "$ref": "#/definitions/TagIds"
- }
- }
- }
- },
- "assetHistoryEndTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs.",
- "name": "endMs",
- "in": "query",
- "required": true
- },
- "assetHistoryStartTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs.",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- "assetIdParam": {
- "type": "integer",
- "format": "int64",
- "description": "ID of the asset. Must contain only digits 0-9.",
- "name": "asset_id",
- "in": "path",
- "required": true
- },
- "createDriverParam": {
- "description": "Driver creation body",
- "name": "createDriverParam",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/DriverForCreate"
- }
- },
- "createDvirParam": {
- "description": "DVIR creation body",
- "name": "createDvirParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "safe",
- "inspectionType",
- "userEmail"
- ],
- "properties": {
- "inspectionType": {
- "description": "Only type 'mechanic' is currently accepted.",
- "type": "string",
- "enum": [
- "mechanic"
- ],
- "example": "mechanic"
- },
- "mechanicNotes": {
- "description": "Any notes from the mechanic.",
- "type": "string",
- "example": "Replaced headlight on passenger side."
- },
- "odometerMiles": {
- "description": "The current odometer of the vehicle.",
- "type": "integer",
- "example": 38426
- },
- "previousDefectsCorrected": {
- "description": "Whether any previous defects were corrected. If this vehicle or trailer was previously marked unsafe, and this DVIR marks it as safe, either previousDefectsCorrected or previousDefectsIgnored must be true.",
- "type": "boolean",
- "example": true
- },
- "previousDefectsIgnored": {
- "description": "Whether any previous defects were ignored. If this vehicle or trailer was previously marked unsafe, and this DVIR marks it as safe, either previousDefectsCorrected or previousDefectsIgnored must be true.",
- "type": "boolean",
- "example": false
- },
- "safe": {
- "description": "Whether or not this vehicle or trailer is safe to drive.",
- "type": "string",
- "enum": [
- "safe",
- "unsafe"
- ],
- "example": "safe"
- },
- "trailerId": {
- "description": "Id of trailer being inspected. Either vehicleId or trailerId must be provided.",
- "type": "integer",
- "example": 11
- },
- "userEmail": {
- "description": "The Samsara login email for the person creating the DVIR. The email must correspond to a Samsara user's email.",
- "type": "string",
- "example": "j.smith@yahoo.com"
- },
- "vehicleId": {
- "description": "Id of vehicle being inspected. Either vehicleId or trailerId must be provided.",
- "type": "integer",
- "example": 10
- }
- }
- }
- },
- "createMessagesParam": {
- "description": "Text to send to a list of driverIds.",
- "name": "createMessages",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "driverIds",
- "text"
- ],
- "properties": {
- "driverIds": {
- "description": "IDs of the drivers for whom the messages are sent to.",
- "type": "array",
- "items": {
- "type": "number",
- "format": "int64",
- "example": 555
- },
- "example": [
- 111,
- 222,
- 333
- ]
- },
- "text": {
- "description": "The text sent in the message.",
- "type": "string",
- "example": "This is a message."
- }
- }
- }
- },
- "createUserParam": {
- "description": "User properties. Only one of organizationRoleId or tagRoles is required.",
- "name": "user",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "name",
- "email",
- "authType"
- ],
- "allOf": [
- {
- "$ref": "#/definitions/UpsertUserBase"
- },
- {
- "type": "object",
- "properties": {
- "email": {
- "description": "The email address of this user.",
- "type": "string",
- "example": "user@company.com"
- }
- }
- }
- ]
- }
- },
- "dataInputEndTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in unix milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs. Defaults to nowMs.",
- "name": "endMs",
- "in": "query"
- },
- "dataInputIdParam": {
- "type": "integer",
- "format": "int64",
- "description": "ID of the data input. Must contain only digits 0-9.",
- "name": "data_input_id",
- "in": "path",
- "required": true
- },
- "dataInputStartTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in unix milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs. defaults to nowMs.",
- "name": "startMs",
- "in": "query"
- },
- "documentCreateParam": {
- "description": "To create a document for a given document type, the document type's uuid needs to be passed in to documentTypeUuid. The list of fields passed in should match the document type’s list of field types in the correct order. In other words, a field's valueType and value (i.e. only one of: stringValue, numberValue, or photoValue) at index _i_ should match with the document field type’s valueType at index _i_.",
- "name": "createDocumentParams",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/DocumentCreate"
- }
- },
- "documentsDurationMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Time in milliseconds that represents the duration before endMs to query. Defaults to 24 hours.",
- "name": "durationMs",
- "in": "query"
- },
- "documentsEndMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Time in unix milliseconds that represents the oldest documents to return. Used in combination with durationMs. Defaults to now.",
- "name": "endMs",
- "in": "query"
- },
- "driverIdOrExternalIdParam": {
- "type": "string",
- "description": "ID of the driver. This must be either the numeric ID generated by Samsara or the external ID of the driver. Driver ID must contain only digits 0-9. External IDs are customer specified key-value pairs and must contain only alphanumeric characters.",
- "name": "driver_id_or_external_id",
- "in": "path",
- "required": true
- },
- "getMessagesDurationMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Time in milliseconds that represents the duration before endMs to query. Defaults to 24 hours.",
- "name": "durationMs",
- "in": "query"
- },
- "getMessagesEndMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Time in unix milliseconds that represents the end of time range of messages to return. Used in combination with durationMs. Defaults to now.",
- "name": "endMs",
- "in": "query"
- },
- "groupIdBodyParam": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "name": "groupIdBodyParam",
- "in": "body",
- "schema": {
- "type": "object",
- "required": [
- "groupId"
- ],
- "properties": {
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- }
- }
- }
- },
- "groupIdParam": {
- "type": "integer",
- "format": "int64",
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "name": "group_id",
- "in": "query"
- },
- "groupIdQueryParam": {
- "type": "integer",
- "format": "int64",
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "name": "groupId",
- "in": "query"
- },
- "harshEventMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in milliseconds representing the timestamp of a harsh event.",
- "name": "timestamp",
- "in": "query",
- "required": true
- },
- "jobUpdatesIncludeParam": {
- "type": "string",
- "description": "Optionally set include=route to include route object in response payload.",
- "name": "include",
- "in": "query"
- },
- "lastReceivedSequenceIDParam": {
- "type": "string",
- "description": "Sequence ID from the response payload of the last request. Defaults to fetching updates from last 24 hours.",
- "name": "sequence_id",
- "in": "query"
- },
- "paginationEndingBeforeParam": {
- "type": "string",
- "description": "Pagination parameter indicating the cursor position to return results before. Used in conjunction with the 'limit' parameter. Mutually exclusive with 'startingAfter' parameter.",
- "name": "endingBefore",
- "in": "query"
- },
- "paginationLimitParam": {
- "type": "number",
- "format": "int64",
- "description": "Pagination parameter indicating the number of results to return in this request. Used in conjunction with either 'startingAfter' or 'endingBefore'.",
- "name": "limit",
- "in": "query"
- },
- "paginationStartingAfterParam": {
- "type": "string",
- "description": "Pagination parameter indicating the cursor position to continue returning results after. Used in conjunction with the 'limit' parameter. Mutually exclusive with 'endingBefore' parameter.",
- "name": "startingAfter",
- "in": "query"
- },
- "reactivateDriverParam": {
- "description": "Driver reactivation body",
- "name": "reactivateDriverParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "reactivate"
- ],
- "properties": {
- "reactivate": {
- "description": "True indicates that this driver should be reactivated.",
- "type": "boolean"
- }
- }
- }
- },
- "routeCreateParam": {
- "name": "createDispatchRouteParams",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/DispatchRouteCreate"
- }
- },
- "routeDurationParam": {
- "type": "integer",
- "format": "int64",
- "description": "Time in milliseconds that represents the duration before end_time to query. Defaults to 24 hours.",
- "name": "duration",
- "in": "query"
- },
- "routeEndTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Time in unix milliseconds that represents the oldest routes to return. Used in combination with duration. Defaults to now.",
- "name": "end_time",
- "in": "query"
- },
- "routeHistoryEndTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp representing the end of the period to fetch, inclusive. Used in combination with start_time. Defaults to nowMs.",
- "name": "end_time",
- "in": "query"
- },
- "routeHistoryStartTimeParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp representing the start of the period to fetch, inclusive. Used in combination with end_time. Defaults to 0.",
- "name": "start_time",
- "in": "query"
- },
- "routeUpdateParam": {
- "name": "updateDispatchRouteParams",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/DispatchRouteUpdate"
- }
- },
- "safetyScoreEndMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs.",
- "name": "endMs",
- "in": "query",
- "required": true
- },
- "safetyScoreStartMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "Timestamp in milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs.",
- "name": "startMs",
- "in": "query",
- "required": true
- },
- "sensorParam": {
- "description": "Group ID and list of sensor IDs to query.",
- "name": "sensorParam",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "groupId",
- "sensors"
- ],
- "properties": {
- "groupId": {
- "description": "Optional group ID if the organization has multiple groups (uncommon).",
- "type": "integer",
- "format": "int64",
- "example": 101
- },
- "sensors": {
- "description": "List of sensor IDs to query.",
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int64"
- },
- "example": [
- 122
- ]
- }
- }
- }
- },
- "tagCreateParam": {
- "name": "tagCreateParams",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/TagCreate"
- }
- },
- "tagModifyParam": {
- "name": "tagModifyParams",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/TagModify"
- }
- },
- "tagPathParam": {
- "type": "integer",
- "format": "int64",
- "description": "ID of the tag. Must contain only digits 0-9.",
- "name": "tag_id",
- "in": "path",
- "required": true
- },
- "tagUpdateParam": {
- "name": "updateTagParams",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/TagUpdate"
- }
- },
- "updateContactParam": {
- "description": "Update parts of a contact",
- "name": "contact",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/ContactInput"
- }
- },
- "updateDriverParam": {
- "description": "Driver update body",
- "name": "updateDriverParam",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/DriverForUpdate"
- }
- },
- "updateUserParam": {
- "description": "User properties. Note that when updating tagRoles, the complete list of tag roles must be supplied for the user. To delete all tag roles set the value to null or an empty array.",
- "name": "user",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/UpsertUserBase"
- }
- },
- "vehicleIdOrExternalIdParam": {
- "type": "string",
- "description": "ID of the vehicle. This must be either the numeric ID generated by Samsara or the external ID of the vehicle. Vehicle ID must contain only digits 0-9. External IDs are customer specified key-value pairs and must contain only alphanumeric characters.",
- "name": "vehicle_id_or_external_id",
- "in": "path",
- "required": true
- },
- "visionCameraIdParam": {
- "type": "integer",
- "format": "int64",
- "description": "The camera_id should be valid for the given accessToken.",
- "name": "camera_id",
- "in": "path",
- "required": true
- },
- "visionDurationMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "DurationMs is a required param. This works with the EndMs parameter. Indicates the duration in which the visionRuns will be fetched",
- "name": "durationMs",
- "in": "query",
- "required": true
- },
- "visionEndMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "EndMs is an optional param. It will default to the current time.",
- "name": "endMs",
- "in": "query"
- },
- "visionIncludeParam": {
- "type": "string",
- "description": "Include is a filter parameter. Accepts 'pass', 'reject' or 'no_read'.",
- "name": "include",
- "in": "query"
- },
- "visionLimitParam": {
- "type": "integer",
- "format": "int64",
- "description": "Limit is an integer value from 1 to 1,000.",
- "name": "limit",
- "in": "query"
- },
- "visionProgramIdParam": {
- "type": "integer",
- "format": "int64",
- "description": "The configured program's ID on the camera.",
- "name": "program_id",
- "in": "query"
- },
- "visionStartAtMsParam": {
- "type": "integer",
- "format": "int64",
- "description": "EndMs is an optional param. It will default to the current time.",
- "name": "startedAtMs",
- "in": "query"
- }
- },
- "tags": [
- {
- "description": "Access to fleet data",
- "name": "Fleet"
- },
- {
- "description": "Access to industrial data",
- "name": "Industrial"
- },
- {
- "description": "Access to sensor data",
- "name": "Sensors"
- },
- {
- "description": "Access to asset specific data",
- "name": "Assets"
- },
- {
- "description": "Access to safety specific data",
- "name": "Safety"
- },
- {
- "description": "Access to user data",
- "name": "Users"
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement