Advertisement
Guest User

Untitled

a guest
May 3rd, 2019
1,568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 281.24 KB | None | 0 0
  1. {
  2. "consumes": [
  3. "application/json"
  4. ],
  5. "produces": [
  6. "application/json"
  7. ],
  8. "schemes": [
  9. "https"
  10. ],
  11. "swagger": "2.0",
  12. "info": {
  13. "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).",
  14. "title": "Samsara API",
  15. "version": "1.0.0"
  16. },
  17. "host": "api.samsara.com",
  18. "paths": {
  19. "/v1/addresses": {
  20. "get": {
  21. "description": "Fetch all addresses/geofences for the organization. An address contains either a circle or polygon geofence describing the address boundaries.",
  22. "tags": [
  23. "Fleet"
  24. ],
  25. "summary": "/addresses",
  26. "operationId": "getOrganizationAddresses",
  27. "parameters": [
  28. {
  29. "$ref": "#/parameters/accessTokenParam"
  30. },
  31. {
  32. "$ref": "#/parameters/groupIdQueryParam"
  33. }
  34. ],
  35. "responses": {
  36. "200": {
  37. "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.",
  38. "schema": {
  39. "type": "array",
  40. "items": {
  41. "$ref": "#/definitions/Address"
  42. }
  43. }
  44. },
  45. "default": {
  46. "description": "Unexpected error.",
  47. "schema": {
  48. "$ref": "#/definitions/ErrorResponse"
  49. }
  50. }
  51. }
  52. },
  53. "post": {
  54. "description": "Add one or more addresses to the organization",
  55. "tags": [
  56. "Fleet"
  57. ],
  58. "summary": "/addresses",
  59. "operationId": "addOrganizationAddresses",
  60. "parameters": [
  61. {
  62. "$ref": "#/parameters/accessTokenParam"
  63. },
  64. {
  65. "$ref": "#/parameters/addressAddParam"
  66. }
  67. ],
  68. "responses": {
  69. "200": {
  70. "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.",
  71. "schema": {
  72. "type": "array",
  73. "items": {
  74. "$ref": "#/definitions/Address"
  75. }
  76. }
  77. },
  78. "default": {
  79. "description": "Unexpected error.",
  80. "schema": {
  81. "$ref": "#/definitions/ErrorResponse"
  82. }
  83. }
  84. }
  85. }
  86. },
  87. "/v1/addresses/{addressId}": {
  88. "get": {
  89. "description": "Fetch an address by its id.",
  90. "tags": [
  91. "Fleet"
  92. ],
  93. "summary": "/addresses/{addressId}",
  94. "operationId": "getOrganizationAddress",
  95. "parameters": [
  96. {
  97. "$ref": "#/parameters/accessTokenParam"
  98. },
  99. {
  100. "type": "integer",
  101. "format": "int64",
  102. "description": "ID of the address/geofence",
  103. "name": "addressId",
  104. "in": "path",
  105. "required": true
  106. }
  107. ],
  108. "responses": {
  109. "200": {
  110. "description": "The address/geofence. The geofence field will only be populated with either 'circle' or 'polygon', depending on the geofence type.",
  111. "schema": {
  112. "$ref": "#/definitions/Address"
  113. }
  114. },
  115. "default": {
  116. "description": "Unexpected error.",
  117. "schema": {
  118. "$ref": "#/definitions/ErrorResponse"
  119. }
  120. }
  121. }
  122. },
  123. "delete": {
  124. "description": "Delete an address.",
  125. "tags": [
  126. "Fleet"
  127. ],
  128. "summary": "/addresses/{addressId}",
  129. "operationId": "deleteOrganizationAddress",
  130. "parameters": [
  131. {
  132. "$ref": "#/parameters/accessTokenParam"
  133. },
  134. {
  135. "type": "integer",
  136. "format": "int64",
  137. "description": "ID of the address/geofence",
  138. "name": "addressId",
  139. "in": "path",
  140. "required": true
  141. }
  142. ],
  143. "responses": {
  144. "200": {
  145. "description": "Address was successfully deleted. No response body is returned."
  146. },
  147. "default": {
  148. "description": "Unexpected error.",
  149. "schema": {
  150. "$ref": "#/definitions/ErrorResponse"
  151. }
  152. }
  153. }
  154. },
  155. "patch": {
  156. "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.",
  157. "tags": [
  158. "Fleet"
  159. ],
  160. "summary": "/addresses/{addressId}",
  161. "operationId": "updateOrganizationAddress",
  162. "parameters": [
  163. {
  164. "$ref": "#/parameters/accessTokenParam"
  165. },
  166. {
  167. "$ref": "#/parameters/addressUpdateParam"
  168. },
  169. {
  170. "type": "integer",
  171. "format": "int64",
  172. "description": "ID of the address/geofence",
  173. "name": "addressId",
  174. "in": "path",
  175. "required": true
  176. }
  177. ],
  178. "responses": {
  179. "200": {
  180. "description": "Address was successfully updated. No response body is returned."
  181. },
  182. "default": {
  183. "description": "Unexpected error.",
  184. "schema": {
  185. "$ref": "#/definitions/ErrorResponse"
  186. }
  187. }
  188. }
  189. }
  190. },
  191. "/v1/contacts": {
  192. "get": {
  193. "description": "Fetch all contacts for the organization.",
  194. "tags": [
  195. "Contacts"
  196. ],
  197. "summary": "/contacts",
  198. "operationId": "listContacts",
  199. "parameters": [
  200. {
  201. "$ref": "#/parameters/accessTokenParam"
  202. }
  203. ],
  204. "responses": {
  205. "200": {
  206. "description": "List of contacts.",
  207. "schema": {
  208. "type": "array",
  209. "items": {
  210. "$ref": "#/definitions/Contact"
  211. }
  212. }
  213. },
  214. "default": {
  215. "description": "Unexpected error.",
  216. "schema": {
  217. "$ref": "#/definitions/ErrorResponse"
  218. }
  219. }
  220. }
  221. },
  222. "post": {
  223. "description": "Add a contact to the organization",
  224. "tags": [
  225. "Contacts"
  226. ],
  227. "summary": "/contacts",
  228. "operationId": "addOrganizationContact",
  229. "parameters": [
  230. {
  231. "$ref": "#/parameters/accessTokenParam"
  232. },
  233. {
  234. "$ref": "#/parameters/addContactParam"
  235. }
  236. ],
  237. "responses": {
  238. "200": {
  239. "description": "Contact was successfully added.",
  240. "schema": {
  241. "$ref": "#/definitions/ContactData"
  242. }
  243. },
  244. "default": {
  245. "description": "Unexpected error.",
  246. "schema": {
  247. "$ref": "#/definitions/ErrorResponse"
  248. }
  249. }
  250. }
  251. }
  252. },
  253. "/v1/contacts/{contact_id}": {
  254. "get": {
  255. "description": "Fetch a contact by its id.",
  256. "tags": [
  257. "Contacts"
  258. ],
  259. "summary": "/contacts/{contact_id}",
  260. "operationId": "getOrganizationContact",
  261. "parameters": [
  262. {
  263. "$ref": "#/parameters/accessTokenParam"
  264. },
  265. {
  266. "type": "integer",
  267. "format": "int64",
  268. "description": "ID of the contact",
  269. "name": "contact_id",
  270. "in": "path",
  271. "required": true
  272. }
  273. ],
  274. "responses": {
  275. "200": {
  276. "description": "The contact.",
  277. "schema": {
  278. "$ref": "#/definitions/Contact"
  279. }
  280. },
  281. "default": {
  282. "description": "Unexpected error.",
  283. "schema": {
  284. "$ref": "#/definitions/ErrorResponse"
  285. }
  286. }
  287. }
  288. },
  289. "delete": {
  290. "description": "Delete a contact.",
  291. "tags": [
  292. "Contacts"
  293. ],
  294. "summary": "/contacts/{contact_id}",
  295. "operationId": "deleteOrganizationContact",
  296. "parameters": [
  297. {
  298. "$ref": "#/parameters/accessTokenParam"
  299. },
  300. {
  301. "type": "integer",
  302. "format": "int64",
  303. "description": "ID of the contact",
  304. "name": "contact_id",
  305. "in": "path",
  306. "required": true
  307. }
  308. ],
  309. "responses": {
  310. "200": {
  311. "description": "Contact was successfully deleted."
  312. },
  313. "default": {
  314. "description": "Unexpected error.",
  315. "schema": {
  316. "$ref": "#/definitions/ErrorResponse"
  317. }
  318. }
  319. }
  320. },
  321. "patch": {
  322. "description": "Update a contact by its id.",
  323. "tags": [
  324. "Contacts"
  325. ],
  326. "summary": "/contacts/{contact_id}",
  327. "operationId": "updateOrganizationContact",
  328. "parameters": [
  329. {
  330. "$ref": "#/parameters/accessTokenParam"
  331. },
  332. {
  333. "$ref": "#/parameters/updateContactParam"
  334. },
  335. {
  336. "type": "integer",
  337. "format": "int64",
  338. "description": "ID of the contact",
  339. "name": "contact_id",
  340. "in": "path",
  341. "required": true
  342. }
  343. ],
  344. "responses": {
  345. "200": {
  346. "description": "Contact was successfully updated.",
  347. "schema": {
  348. "$ref": "#/definitions/ContactData"
  349. }
  350. },
  351. "default": {
  352. "description": "Unexpected error.",
  353. "schema": {
  354. "$ref": "#/definitions/ErrorResponse"
  355. }
  356. }
  357. }
  358. }
  359. },
  360. "/v1/fleet/add_address": {
  361. "post": {
  362. "description": "This method adds an address book entry to the specified group.",
  363. "tags": [
  364. "Fleet"
  365. ],
  366. "summary": "/fleet/add_address",
  367. "operationId": "addFleetAddress",
  368. "parameters": [
  369. {
  370. "$ref": "#/parameters/accessTokenParam"
  371. },
  372. {
  373. "name": "addressParam",
  374. "in": "body",
  375. "required": true,
  376. "schema": {
  377. "type": "object",
  378. "required": [
  379. "groupId",
  380. "name",
  381. "address",
  382. "radius"
  383. ],
  384. "properties": {
  385. "address": {
  386. "description": "The address of the entry to add, as it would be recognized if provided to maps.google.com.",
  387. "type": "string",
  388. "example": "501 York St"
  389. },
  390. "groupId": {
  391. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  392. "type": "integer",
  393. "format": "int64",
  394. "example": 101
  395. },
  396. "name": {
  397. "description": "Name of the location to add to the address book.",
  398. "type": "string",
  399. "example": "HQ"
  400. },
  401. "radius": {
  402. "description": "Radius in meters of the address (used for matching vehicle trip stops to this location).",
  403. "type": "integer",
  404. "example": 10
  405. }
  406. }
  407. }
  408. }
  409. ],
  410. "responses": {
  411. "200": {
  412. "description": "Address was successfully added. No response body is returned."
  413. },
  414. "default": {
  415. "description": "Unexpected error.",
  416. "schema": {
  417. "$ref": "#/definitions/ErrorResponse"
  418. }
  419. }
  420. }
  421. }
  422. },
  423. "/v1/fleet/assets": {
  424. "get": {
  425. "description": "Fetch all of the assets for the group.",
  426. "tags": [
  427. "Fleet",
  428. "Assets"
  429. ],
  430. "summary": "/fleet/assets",
  431. "operationId": "getAllAssets",
  432. "parameters": [
  433. {
  434. "$ref": "#/parameters/accessTokenParam"
  435. },
  436. {
  437. "$ref": "#/parameters/groupIdQueryParam"
  438. }
  439. ],
  440. "responses": {
  441. "200": {
  442. "description": "List of assets.",
  443. "schema": {
  444. "type": "object",
  445. "properties": {
  446. "assets": {
  447. "type": "array",
  448. "items": {
  449. "$ref": "#/definitions/Asset"
  450. }
  451. }
  452. }
  453. }
  454. },
  455. "default": {
  456. "description": "Unexpected error.",
  457. "schema": {
  458. "$ref": "#/definitions/ErrorResponse"
  459. }
  460. }
  461. }
  462. }
  463. },
  464. "/v1/fleet/assets/locations": {
  465. "get": {
  466. "description": "Fetch current locations of all assets for the group.",
  467. "tags": [
  468. "Fleet",
  469. "Assets"
  470. ],
  471. "summary": "/fleet/assets/locations",
  472. "operationId": "getAllAssetCurrentLocations",
  473. "parameters": [
  474. {
  475. "$ref": "#/parameters/accessTokenParam"
  476. },
  477. {
  478. "$ref": "#/parameters/groupIdQueryParam"
  479. }
  480. ],
  481. "responses": {
  482. "200": {
  483. "description": "List of assets and their current locations.",
  484. "schema": {
  485. "type": "object",
  486. "properties": {
  487. "assets": {
  488. "type": "array",
  489. "items": {
  490. "$ref": "#/definitions/AssetCurrentLocationsResponse"
  491. }
  492. }
  493. }
  494. }
  495. },
  496. "default": {
  497. "description": "Unexpected error.",
  498. "schema": {
  499. "$ref": "#/definitions/ErrorResponse"
  500. }
  501. }
  502. }
  503. }
  504. },
  505. "/v1/fleet/assets/{asset_id}/locations": {
  506. "get": {
  507. "description": "Fetch the historical locations for the asset.",
  508. "tags": [
  509. "Fleet",
  510. "Assets"
  511. ],
  512. "summary": "/fleet/assets/{assetId}/locations",
  513. "operationId": "getAssetLocation",
  514. "parameters": [
  515. {
  516. "$ref": "#/parameters/accessTokenParam"
  517. },
  518. {
  519. "$ref": "#/parameters/assetIdParam"
  520. },
  521. {
  522. "$ref": "#/parameters/assetHistoryStartTimeParam"
  523. },
  524. {
  525. "$ref": "#/parameters/assetHistoryEndTimeParam"
  526. }
  527. ],
  528. "responses": {
  529. "200": {
  530. "description": "Asset location details.",
  531. "schema": {
  532. "$ref": "#/definitions/AssetLocationResponse"
  533. }
  534. },
  535. "default": {
  536. "description": "Unexpected error.",
  537. "schema": {
  538. "$ref": "#/definitions/ErrorResponse"
  539. }
  540. }
  541. }
  542. }
  543. },
  544. "/v1/fleet/assets/{asset_id}/reefer": {
  545. "get": {
  546. "description": "Fetch the reefer-specific stats of an asset.",
  547. "tags": [
  548. "Fleet",
  549. "Assets"
  550. ],
  551. "summary": "/fleet/assets/{assetId}/reefer",
  552. "operationId": "getAssetReefer",
  553. "parameters": [
  554. {
  555. "$ref": "#/parameters/accessTokenParam"
  556. },
  557. {
  558. "$ref": "#/parameters/assetIdParam"
  559. },
  560. {
  561. "$ref": "#/parameters/assetHistoryStartTimeParam"
  562. },
  563. {
  564. "$ref": "#/parameters/assetHistoryEndTimeParam"
  565. }
  566. ],
  567. "responses": {
  568. "200": {
  569. "description": "Reefer-specific asset details.",
  570. "schema": {
  571. "$ref": "#/definitions/AssetReeferResponse"
  572. }
  573. },
  574. "default": {
  575. "description": "Unexpected error.",
  576. "schema": {
  577. "$ref": "#/definitions/ErrorResponse"
  578. }
  579. }
  580. }
  581. }
  582. },
  583. "/v1/fleet/dispatch/routes": {
  584. "get": {
  585. "description": "Fetch all of the dispatch routes for the group.",
  586. "consumes": [
  587. "application/json"
  588. ],
  589. "produces": [
  590. "application/json"
  591. ],
  592. "tags": [
  593. "Fleet",
  594. "Routes"
  595. ],
  596. "summary": "/fleet/dispatch/routes",
  597. "operationId": "fetchAllDispatchRoutes",
  598. "parameters": [
  599. {
  600. "$ref": "#/parameters/accessTokenParam"
  601. },
  602. {
  603. "$ref": "#/parameters/groupIdParam"
  604. },
  605. {
  606. "$ref": "#/parameters/routeEndTimeParam"
  607. },
  608. {
  609. "$ref": "#/parameters/routeDurationParam"
  610. }
  611. ],
  612. "responses": {
  613. "200": {
  614. "description": "All dispatch route objects for the group.",
  615. "schema": {
  616. "$ref": "#/definitions/DispatchRoutes"
  617. }
  618. },
  619. "default": {
  620. "description": "Unexpected error.",
  621. "schema": {
  622. "$ref": "#/definitions/ErrorResponse"
  623. }
  624. }
  625. }
  626. },
  627. "post": {
  628. "description": "Create a new dispatch route.",
  629. "consumes": [
  630. "application/json"
  631. ],
  632. "produces": [
  633. "application/json"
  634. ],
  635. "tags": [
  636. "Fleet",
  637. "Routes"
  638. ],
  639. "summary": "/fleet/dispatch/routes",
  640. "operationId": "createDispatchRoute",
  641. "parameters": [
  642. {
  643. "$ref": "#/parameters/accessTokenParam"
  644. },
  645. {
  646. "$ref": "#/parameters/routeCreateParam"
  647. }
  648. ],
  649. "responses": {
  650. "200": {
  651. "description": "Created route object including the new route ID.",
  652. "schema": {
  653. "$ref": "#/definitions/DispatchRoute"
  654. }
  655. },
  656. "default": {
  657. "description": "Unexpected error.",
  658. "schema": {
  659. "$ref": "#/definitions/ErrorResponse"
  660. }
  661. }
  662. }
  663. }
  664. },
  665. "/v1/fleet/dispatch/routes/job_updates": {
  666. "get": {
  667. "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.",
  668. "consumes": [
  669. "application/json"
  670. ],
  671. "produces": [
  672. "application/json"
  673. ],
  674. "tags": [
  675. "Fleet",
  676. "Routes"
  677. ],
  678. "summary": "/fleet/dispatch/routes/job_updates",
  679. "operationId": "fetchAllRouteJobUpdates",
  680. "parameters": [
  681. {
  682. "$ref": "#/parameters/accessTokenParam"
  683. },
  684. {
  685. "$ref": "#/parameters/groupIdParam"
  686. },
  687. {
  688. "$ref": "#/parameters/lastReceivedSequenceIDParam"
  689. },
  690. {
  691. "$ref": "#/parameters/jobUpdatesIncludeParam"
  692. }
  693. ],
  694. "responses": {
  695. "200": {
  696. "description": "All job updates on routes.",
  697. "schema": {
  698. "$ref": "#/definitions/allRouteJobUpdates"
  699. }
  700. },
  701. "default": {
  702. "description": "Unexpected error.",
  703. "schema": {
  704. "$ref": "#/definitions/ErrorResponse"
  705. }
  706. }
  707. }
  708. }
  709. },
  710. "/v1/fleet/dispatch/routes/{route_id}": {
  711. "get": {
  712. "description": "Fetch a dispatch route by id.",
  713. "consumes": [
  714. "application/json"
  715. ],
  716. "produces": [
  717. "application/json"
  718. ],
  719. "tags": [
  720. "Fleet",
  721. "Routes"
  722. ],
  723. "summary": "/fleet/dispatch/routes/{route_id}",
  724. "operationId": "getDispatchRouteById",
  725. "responses": {
  726. "200": {
  727. "description": "The dispatch route corresponding to route_id.",
  728. "schema": {
  729. "$ref": "#/definitions/DispatchRoute"
  730. }
  731. },
  732. "default": {
  733. "description": "Unexpected error.",
  734. "schema": {
  735. "$ref": "#/definitions/ErrorResponse"
  736. }
  737. }
  738. }
  739. },
  740. "put": {
  741. "description": "Update a dispatch route and its associated jobs.",
  742. "consumes": [
  743. "application/json"
  744. ],
  745. "produces": [
  746. "application/json"
  747. ],
  748. "tags": [
  749. "Fleet",
  750. "Routes"
  751. ],
  752. "summary": "/fleet/dispatch/routes/{route_id}/",
  753. "operationId": "updateDispatchRouteById",
  754. "parameters": [
  755. {
  756. "$ref": "#/parameters/routeUpdateParam"
  757. }
  758. ],
  759. "responses": {
  760. "200": {
  761. "description": "Update the dispatch route. Allowable updates include setting job state, adding or removing jobs, and changing job locations and times.",
  762. "schema": {
  763. "$ref": "#/definitions/DispatchRoute"
  764. }
  765. },
  766. "default": {
  767. "description": "Unexpected error.",
  768. "schema": {
  769. "$ref": "#/definitions/ErrorResponse"
  770. }
  771. }
  772. }
  773. },
  774. "delete": {
  775. "description": "Delete a dispatch route and its associated jobs.",
  776. "consumes": [
  777. "application/json"
  778. ],
  779. "produces": [
  780. "application/json"
  781. ],
  782. "tags": [
  783. "Fleet",
  784. "Routes"
  785. ],
  786. "summary": "/fleet/dispatch/routes/{route_id}/",
  787. "operationId": "deleteDispatchRouteById",
  788. "responses": {
  789. "200": {
  790. "description": "Successfully deleted the dispatch route. No response body is returned."
  791. },
  792. "default": {
  793. "description": "Unexpected error.",
  794. "schema": {
  795. "$ref": "#/definitions/ErrorResponse"
  796. }
  797. }
  798. }
  799. },
  800. "parameters": [
  801. {
  802. "$ref": "#/parameters/accessTokenParam"
  803. },
  804. {
  805. "type": "integer",
  806. "format": "int64",
  807. "description": "ID of the dispatch route. Must contain only digits 0-9.",
  808. "name": "route_id",
  809. "in": "path",
  810. "required": true
  811. }
  812. ]
  813. },
  814. "/v1/fleet/dispatch/routes/{route_id}/history": {
  815. "get": {
  816. "description": "Fetch the history of a dispatch route.",
  817. "consumes": [
  818. "application/json"
  819. ],
  820. "produces": [
  821. "application/json"
  822. ],
  823. "tags": [
  824. "Fleet",
  825. "Routes"
  826. ],
  827. "summary": "/fleet/dispatch/routes/{route_id}/history",
  828. "operationId": "getDispatchRouteHistory",
  829. "parameters": [
  830. {
  831. "$ref": "#/parameters/accessTokenParam"
  832. },
  833. {
  834. "$ref": "#/parameters/routeHistoryStartTimeParam"
  835. },
  836. {
  837. "$ref": "#/parameters/routeHistoryEndTimeParam"
  838. },
  839. {
  840. "type": "integer",
  841. "format": "int64",
  842. "description": "ID of the route with history. Must contain only digits 0-9.",
  843. "name": "route_id",
  844. "in": "path",
  845. "required": true
  846. }
  847. ],
  848. "responses": {
  849. "200": {
  850. "description": "The historical route state changes between start_time and end_time.",
  851. "schema": {
  852. "$ref": "#/definitions/DispatchRouteHistory"
  853. }
  854. },
  855. "default": {
  856. "description": "Unexpected error.",
  857. "schema": {
  858. "$ref": "#/definitions/ErrorResponse"
  859. }
  860. }
  861. }
  862. }
  863. },
  864. "/v1/fleet/drivers": {
  865. "get": {
  866. "description": "Get all the drivers for the specified group.",
  867. "tags": [
  868. "Fleet"
  869. ],
  870. "summary": "/fleet/drivers",
  871. "operationId": "getFleetDrivers",
  872. "parameters": [
  873. {
  874. "$ref": "#/parameters/accessTokenParam"
  875. },
  876. {
  877. "$ref": "#/parameters/groupIdQueryParam"
  878. }
  879. ],
  880. "responses": {
  881. "200": {
  882. "description": "All drivers in the group.",
  883. "schema": {
  884. "$ref": "#/definitions/DriversResponse"
  885. }
  886. },
  887. "default": {
  888. "description": "Unexpected error.",
  889. "schema": {
  890. "$ref": "#/definitions/ErrorResponse"
  891. }
  892. }
  893. }
  894. }
  895. },
  896. "/v1/fleet/drivers/create": {
  897. "post": {
  898. "description": "Create a new driver.",
  899. "consumes": [
  900. "application/json"
  901. ],
  902. "produces": [
  903. "application/json"
  904. ],
  905. "tags": [
  906. "Fleet",
  907. "Drivers"
  908. ],
  909. "summary": "/fleet/drivers/create",
  910. "operationId": "createDriver",
  911. "parameters": [
  912. {
  913. "$ref": "#/parameters/accessTokenParam"
  914. },
  915. {
  916. "$ref": "#/parameters/createDriverParam"
  917. }
  918. ],
  919. "responses": {
  920. "200": {
  921. "description": "Returns the successfully created the driver.",
  922. "schema": {
  923. "$ref": "#/definitions/Driver"
  924. }
  925. },
  926. "default": {
  927. "description": "Unexpected error.",
  928. "schema": {
  929. "$ref": "#/definitions/ErrorResponse"
  930. }
  931. }
  932. }
  933. }
  934. },
  935. "/v1/fleet/drivers/document_types": {
  936. "get": {
  937. "description": "Fetch all of the document types.",
  938. "consumes": [
  939. "application/json"
  940. ],
  941. "produces": [
  942. "application/json"
  943. ],
  944. "tags": [
  945. "Fleet"
  946. ],
  947. "summary": "/fleet/drivers/document_types",
  948. "operationId": "getDriverDocumentTypesByOrgId",
  949. "parameters": [
  950. {
  951. "$ref": "#/parameters/accessTokenParam"
  952. }
  953. ],
  954. "responses": {
  955. "200": {
  956. "description": "Returns all of the document types.",
  957. "schema": {
  958. "$ref": "#/definitions/DocumentTypes"
  959. }
  960. },
  961. "default": {
  962. "description": "Unexpected error.",
  963. "schema": {
  964. "$ref": "#/definitions/ErrorResponse"
  965. }
  966. }
  967. }
  968. }
  969. },
  970. "/v1/fleet/drivers/documents": {
  971. "get": {
  972. "description": "Fetch all of the documents.",
  973. "consumes": [
  974. "application/json"
  975. ],
  976. "produces": [
  977. "application/json"
  978. ],
  979. "tags": [
  980. "Fleet"
  981. ],
  982. "summary": "/fleet/drivers/documents",
  983. "operationId": "getDriverDocumentsByOrgId",
  984. "parameters": [
  985. {
  986. "$ref": "#/parameters/accessTokenParam"
  987. },
  988. {
  989. "$ref": "#/parameters/documentsEndMsParam"
  990. },
  991. {
  992. "$ref": "#/parameters/documentsDurationMsParam"
  993. }
  994. ],
  995. "responses": {
  996. "200": {
  997. "description": "Returns all of the documents.",
  998. "schema": {
  999. "$ref": "#/definitions/Documents"
  1000. }
  1001. },
  1002. "default": {
  1003. "description": "Unexpected error.",
  1004. "schema": {
  1005. "$ref": "#/definitions/ErrorResponse"
  1006. }
  1007. }
  1008. }
  1009. }
  1010. },
  1011. "/v1/fleet/drivers/inactive": {
  1012. "get": {
  1013. "description": "Fetch all deactivated drivers for the group.",
  1014. "consumes": [
  1015. "application/json"
  1016. ],
  1017. "produces": [
  1018. "application/json"
  1019. ],
  1020. "tags": [
  1021. "Fleet",
  1022. "Drivers"
  1023. ],
  1024. "summary": "/fleet/drivers/inactive",
  1025. "operationId": "getAllDeactivatedDrivers",
  1026. "parameters": [
  1027. {
  1028. "$ref": "#/parameters/accessTokenParam"
  1029. },
  1030. {
  1031. "$ref": "#/parameters/groupIdQueryParam"
  1032. }
  1033. ],
  1034. "responses": {
  1035. "200": {
  1036. "description": "Returns an array of all deactivated drivers for the group. Deactivated drivers are referenced at /fleet/drivers/inactive/{driver_id}",
  1037. "schema": {
  1038. "type": "array",
  1039. "items": {
  1040. "$ref": "#/definitions/Driver"
  1041. }
  1042. }
  1043. },
  1044. "default": {
  1045. "description": "Unexpected error.",
  1046. "schema": {
  1047. "$ref": "#/definitions/ErrorResponse"
  1048. }
  1049. }
  1050. }
  1051. }
  1052. },
  1053. "/v1/fleet/drivers/inactive/{driver_id_or_external_id}": {
  1054. "get": {
  1055. "description": "Fetch deactivated driver by id.",
  1056. "consumes": [
  1057. "application/json"
  1058. ],
  1059. "produces": [
  1060. "application/json"
  1061. ],
  1062. "tags": [
  1063. "Fleet",
  1064. "Drivers"
  1065. ],
  1066. "summary": "/fleet/drivers/inactive/{driver_id or external_id}",
  1067. "operationId": "getDeactivatedDriverById",
  1068. "responses": {
  1069. "200": {
  1070. "description": "Returns the deactivated driver with the given driver_id.",
  1071. "schema": {
  1072. "$ref": "#/definitions/Driver"
  1073. }
  1074. },
  1075. "default": {
  1076. "description": "Unexpected error.",
  1077. "schema": {
  1078. "$ref": "#/definitions/ErrorResponse"
  1079. }
  1080. }
  1081. }
  1082. },
  1083. "put": {
  1084. "description": "Reactivate the inactive driver having id.",
  1085. "consumes": [
  1086. "application/json"
  1087. ],
  1088. "produces": [
  1089. "application/json"
  1090. ],
  1091. "tags": [
  1092. "Fleet",
  1093. "Drivers"
  1094. ],
  1095. "summary": "/fleet/drivers/inactive/{driver_id or external_id}",
  1096. "operationId": "reactivateDriverById",
  1097. "parameters": [
  1098. {
  1099. "$ref": "#/parameters/reactivateDriverParam"
  1100. }
  1101. ],
  1102. "responses": {
  1103. "200": {
  1104. "description": "Returns the reactivated driver, which is now available at /fleet/drivers/{driver_id}.",
  1105. "schema": {
  1106. "$ref": "#/definitions/CurrentDriver"
  1107. }
  1108. },
  1109. "default": {
  1110. "description": "Unexpected error.",
  1111. "schema": {
  1112. "$ref": "#/definitions/ErrorResponse"
  1113. }
  1114. }
  1115. }
  1116. },
  1117. "parameters": [
  1118. {
  1119. "$ref": "#/parameters/accessTokenParam"
  1120. },
  1121. {
  1122. "$ref": "#/parameters/driverIdOrExternalIdParam"
  1123. }
  1124. ]
  1125. },
  1126. "/v1/fleet/drivers/summary": {
  1127. "get": {
  1128. "description": "Get the distance and time each driver in an organization has driven in a given time period.",
  1129. "tags": [
  1130. "Fleet"
  1131. ],
  1132. "summary": "/fleet/drivers/summary",
  1133. "operationId": "getFleetDriversSummary",
  1134. "parameters": [
  1135. {
  1136. "$ref": "#/parameters/accessTokenParam"
  1137. },
  1138. {
  1139. "type": "boolean",
  1140. "description": "Snap query result to HOS day boundaries.",
  1141. "name": "snap_to_day_bounds",
  1142. "in": "query"
  1143. },
  1144. {
  1145. "type": "integer",
  1146. "format": "int64",
  1147. "description": "Start time (ms) of queried time period.",
  1148. "name": "startMs",
  1149. "in": "query",
  1150. "required": true
  1151. },
  1152. {
  1153. "type": "integer",
  1154. "format": "int64",
  1155. "description": "End time (ms) of queried time period. Must be greater than startMs.",
  1156. "name": "endMs",
  1157. "in": "query",
  1158. "required": true
  1159. }
  1160. ],
  1161. "responses": {
  1162. "200": {
  1163. "description": "Distance traveled and time active for each driver in the organization over the specified time period.",
  1164. "schema": {
  1165. "$ref": "#/definitions/DriversSummaryResponse"
  1166. }
  1167. },
  1168. "default": {
  1169. "description": "Unexpected error.",
  1170. "schema": {
  1171. "$ref": "#/definitions/ErrorResponse"
  1172. }
  1173. }
  1174. }
  1175. }
  1176. },
  1177. "/v1/fleet/drivers/{driverId}/safety/score": {
  1178. "get": {
  1179. "description": "Fetch the safety score for the driver.",
  1180. "tags": [
  1181. "Fleet",
  1182. "Safety"
  1183. ],
  1184. "summary": "/fleet/drivers/{driverId}/safety/score",
  1185. "operationId": "getDriverSafetyScore",
  1186. "parameters": [
  1187. {
  1188. "$ref": "#/parameters/accessTokenParam"
  1189. },
  1190. {
  1191. "$ref": "#/parameters/safetyScoreStartMsParam"
  1192. },
  1193. {
  1194. "$ref": "#/parameters/safetyScoreEndMsParam"
  1195. },
  1196. {
  1197. "$ref": "#/parameters/groupIdQueryParam"
  1198. }
  1199. ],
  1200. "responses": {
  1201. "200": {
  1202. "description": "Safety score details.",
  1203. "schema": {
  1204. "$ref": "#/definitions/DriverSafetyScoreResponse"
  1205. }
  1206. },
  1207. "default": {
  1208. "description": "Unexpected error.",
  1209. "schema": {
  1210. "$ref": "#/definitions/ErrorResponse"
  1211. }
  1212. }
  1213. }
  1214. },
  1215. "parameters": [
  1216. {
  1217. "type": "integer",
  1218. "format": "int64",
  1219. "description": "ID of the driver. Must contain only digits 0-9.",
  1220. "name": "driverId",
  1221. "in": "path",
  1222. "required": true
  1223. }
  1224. ]
  1225. },
  1226. "/v1/fleet/drivers/{driver_id_or_external_id}": {
  1227. "get": {
  1228. "description": "Fetch driver by id.",
  1229. "consumes": [
  1230. "application/json"
  1231. ],
  1232. "produces": [
  1233. "application/json"
  1234. ],
  1235. "tags": [
  1236. "Fleet",
  1237. "Drivers"
  1238. ],
  1239. "summary": "/fleet/drivers/{driver_id or external_id}",
  1240. "operationId": "getDriverById",
  1241. "responses": {
  1242. "200": {
  1243. "description": "Returns the driver for the given driver_id.",
  1244. "schema": {
  1245. "$ref": "#/definitions/CurrentDriver"
  1246. }
  1247. },
  1248. "default": {
  1249. "description": "Unexpected error.",
  1250. "schema": {
  1251. "$ref": "#/definitions/ErrorResponse"
  1252. }
  1253. }
  1254. }
  1255. },
  1256. "delete": {
  1257. "description": "Deactivate a driver with the given id.",
  1258. "consumes": [
  1259. "application/json"
  1260. ],
  1261. "produces": [
  1262. "application/json"
  1263. ],
  1264. "tags": [
  1265. "Fleet",
  1266. "Drivers"
  1267. ],
  1268. "summary": "/fleet/drivers/{driver_id or external_id}",
  1269. "operationId": "deactivateDriver",
  1270. "responses": {
  1271. "200": {
  1272. "description": "Successfully deactivated the driver, which is now referenced by /fleet/drivers/inactive/{driver_id}."
  1273. },
  1274. "default": {
  1275. "description": "Unexpected error.",
  1276. "schema": {
  1277. "$ref": "#/definitions/ErrorResponse"
  1278. }
  1279. }
  1280. }
  1281. },
  1282. "patch": {
  1283. "description": "Update a driver by id or by external id",
  1284. "consumes": [
  1285. "application/json"
  1286. ],
  1287. "produces": [
  1288. "application/json"
  1289. ],
  1290. "tags": [
  1291. "Fleet",
  1292. "Drivers"
  1293. ],
  1294. "summary": "/fleet/drivers/{driver_id or external_id}",
  1295. "operationId": "updateDriverById",
  1296. "parameters": [
  1297. {
  1298. "$ref": "#/parameters/updateDriverParam"
  1299. }
  1300. ],
  1301. "responses": {
  1302. "200": {
  1303. "description": "Returns the updated driver.",
  1304. "schema": {
  1305. "$ref": "#/definitions/CurrentDriver"
  1306. }
  1307. },
  1308. "default": {
  1309. "description": "Unexpected error.",
  1310. "schema": {
  1311. "$ref": "#/definitions/ErrorResponse"
  1312. }
  1313. }
  1314. }
  1315. },
  1316. "parameters": [
  1317. {
  1318. "$ref": "#/parameters/accessTokenParam"
  1319. },
  1320. {
  1321. "$ref": "#/parameters/driverIdOrExternalIdParam"
  1322. }
  1323. ]
  1324. },
  1325. "/v1/fleet/drivers/{driver_id}/dispatch/routes": {
  1326. "get": {
  1327. "description": "Fetch all of the dispatch routes for a given driver.",
  1328. "consumes": [
  1329. "application/json"
  1330. ],
  1331. "produces": [
  1332. "application/json"
  1333. ],
  1334. "tags": [
  1335. "Fleet",
  1336. "Routes"
  1337. ],
  1338. "summary": "/fleet/drivers/{driver_id}/dispatch/routes",
  1339. "operationId": "getDispatchRoutesByDriverId",
  1340. "parameters": [
  1341. {
  1342. "$ref": "#/parameters/routeEndTimeParam"
  1343. },
  1344. {
  1345. "$ref": "#/parameters/routeDurationParam"
  1346. }
  1347. ],
  1348. "responses": {
  1349. "200": {
  1350. "description": "Returns the dispatch routes for the given driver_id.",
  1351. "schema": {
  1352. "$ref": "#/definitions/DispatchRoutes"
  1353. }
  1354. },
  1355. "default": {
  1356. "description": "Unexpected error.",
  1357. "schema": {
  1358. "$ref": "#/definitions/ErrorResponse"
  1359. }
  1360. }
  1361. }
  1362. },
  1363. "post": {
  1364. "description": "Create a new dispatch route for the driver with driver_id.",
  1365. "consumes": [
  1366. "application/json"
  1367. ],
  1368. "produces": [
  1369. "application/json"
  1370. ],
  1371. "tags": [
  1372. "Fleet",
  1373. "Routes"
  1374. ],
  1375. "summary": "/fleet/drivers/{driver_id}/dispatch/routes",
  1376. "operationId": "createDriverDispatchRoute",
  1377. "parameters": [
  1378. {
  1379. "$ref": "#/parameters/routeCreateParam"
  1380. }
  1381. ],
  1382. "responses": {
  1383. "200": {
  1384. "description": "Created route object including the new route ID.",
  1385. "schema": {
  1386. "$ref": "#/definitions/DispatchRoute"
  1387. }
  1388. },
  1389. "default": {
  1390. "description": "Unexpected error.",
  1391. "schema": {
  1392. "$ref": "#/definitions/ErrorResponse"
  1393. }
  1394. }
  1395. }
  1396. },
  1397. "parameters": [
  1398. {
  1399. "$ref": "#/parameters/accessTokenParam"
  1400. },
  1401. {
  1402. "type": "integer",
  1403. "format": "int64",
  1404. "description": "ID of the driver with the associated routes. Must contain only digits 0-9.",
  1405. "name": "driver_id",
  1406. "in": "path",
  1407. "required": true
  1408. }
  1409. ]
  1410. },
  1411. "/v1/fleet/drivers/{driver_id}/documents": {
  1412. "post": {
  1413. "description": "Create a driver document for the given driver.",
  1414. "consumes": [
  1415. "application/json"
  1416. ],
  1417. "produces": [
  1418. "application/json"
  1419. ],
  1420. "tags": [
  1421. "Fleet"
  1422. ],
  1423. "summary": "/fleet/drivers/{driver_id}/documents",
  1424. "operationId": "createDriverDocument",
  1425. "parameters": [
  1426. {
  1427. "$ref": "#/parameters/accessTokenParam"
  1428. },
  1429. {
  1430. "$ref": "#/parameters/documentCreateParam"
  1431. }
  1432. ],
  1433. "responses": {
  1434. "200": {
  1435. "description": "Returns the created document.",
  1436. "schema": {
  1437. "$ref": "#/definitions/Document"
  1438. }
  1439. },
  1440. "default": {
  1441. "description": "Unexpected error.",
  1442. "schema": {
  1443. "$ref": "#/definitions/ErrorResponse"
  1444. }
  1445. }
  1446. }
  1447. },
  1448. "parameters": [
  1449. {
  1450. "type": "integer",
  1451. "format": "int64",
  1452. "description": "ID of the driver for whom the document is created. Must contain only digits 0-9.",
  1453. "name": "driver_id",
  1454. "in": "path",
  1455. "required": true
  1456. }
  1457. ]
  1458. },
  1459. "/v1/fleet/drivers/{driver_id}/documents/{document_id}": {
  1460. "get": {
  1461. "description": "Fetches a single document submission by driver.",
  1462. "consumes": [
  1463. "application/json"
  1464. ],
  1465. "produces": [
  1466. "application/json"
  1467. ],
  1468. "tags": [
  1469. "Fleet"
  1470. ],
  1471. "summary": "/fleet/drivers/{driver_id}/documents/{document_id}",
  1472. "operationId": "getDriverDocumentByIdAndDriverId",
  1473. "responses": {
  1474. "200": {
  1475. "description": "Returns the specified document.",
  1476. "schema": {
  1477. "$ref": "#/definitions/Document"
  1478. }
  1479. },
  1480. "default": {
  1481. "description": "Unexpected error.",
  1482. "schema": {
  1483. "$ref": "#/definitions/ErrorResponse"
  1484. }
  1485. }
  1486. }
  1487. },
  1488. "parameters": [
  1489. {
  1490. "$ref": "#/parameters/accessTokenParam"
  1491. },
  1492. {
  1493. "type": "integer",
  1494. "format": "int64",
  1495. "description": "ID of the driver who submitted the document. Must contain only digits 0-9.",
  1496. "name": "driver_id",
  1497. "in": "path",
  1498. "required": true
  1499. },
  1500. {
  1501. "type": "string",
  1502. "description": "ID of document.",
  1503. "name": "document_id",
  1504. "in": "path",
  1505. "required": true
  1506. }
  1507. ]
  1508. },
  1509. "/v1/fleet/drivers/{driver_id}/hos_daily_logs": {
  1510. "get": {
  1511. "description": "Get summarized daily HOS charts for a specified driver.",
  1512. "tags": [
  1513. "Fleet"
  1514. ],
  1515. "summary": "/fleet/drivers/{driver_id}/hos_daily_logs",
  1516. "operationId": "getFleetDriversHosDailyLogs",
  1517. "parameters": [
  1518. {
  1519. "$ref": "#/parameters/accessTokenParam"
  1520. },
  1521. {
  1522. "type": "integer",
  1523. "format": "int64",
  1524. "description": "ID of the driver with HOS logs.",
  1525. "name": "driver_id",
  1526. "in": "path",
  1527. "required": true
  1528. },
  1529. {
  1530. "type": "integer",
  1531. "format": "int64",
  1532. "description": "Beginning of the time range, specified in milliseconds UNIX time.",
  1533. "name": "startMs",
  1534. "in": "query",
  1535. "required": true
  1536. },
  1537. {
  1538. "type": "integer",
  1539. "format": "int64",
  1540. "description": "End of the time range, specified in milliseconds UNIX time.",
  1541. "name": "endMs",
  1542. "in": "query",
  1543. "required": true
  1544. },
  1545. {
  1546. "$ref": "#/parameters/groupIdQueryParam"
  1547. }
  1548. ],
  1549. "responses": {
  1550. "200": {
  1551. "description": "Distance traveled and time active for each driver in the organization over the specified time period.",
  1552. "schema": {
  1553. "$ref": "#/definitions/DriverDailyLogResponse"
  1554. }
  1555. },
  1556. "default": {
  1557. "description": "Unexpected error.",
  1558. "schema": {
  1559. "$ref": "#/definitions/ErrorResponse"
  1560. }
  1561. }
  1562. }
  1563. }
  1564. },
  1565. "/v1/fleet/hos_authentication_logs": {
  1566. "get": {
  1567. "description": "Get the HOS (hours of service) signin and signout logs for the specified driver. Only signout logs include location information.",
  1568. "tags": [
  1569. "Fleet"
  1570. ],
  1571. "summary": "/fleet/hos_authentication_logs",
  1572. "operationId": "getFleetHosAuthenticationLogs",
  1573. "parameters": [
  1574. {
  1575. "$ref": "#/parameters/accessTokenParam"
  1576. },
  1577. {
  1578. "$ref": "#/parameters/groupIdQueryParam"
  1579. },
  1580. {
  1581. "type": "integer",
  1582. "format": "int64",
  1583. "description": "Driver ID to query.",
  1584. "name": "driverId",
  1585. "in": "query",
  1586. "required": true
  1587. },
  1588. {
  1589. "type": "integer",
  1590. "format": "int64",
  1591. "description": "Beginning of the time range, specified in milliseconds UNIX time.",
  1592. "name": "startMs",
  1593. "in": "query",
  1594. "required": true
  1595. },
  1596. {
  1597. "type": "integer",
  1598. "format": "int64",
  1599. "description": "End of the time range, specified in milliseconds UNIX time.",
  1600. "name": "endMs",
  1601. "in": "query",
  1602. "required": true
  1603. }
  1604. ],
  1605. "responses": {
  1606. "200": {
  1607. "description": "HOS authentication logs for the specified driver.",
  1608. "schema": {
  1609. "$ref": "#/definitions/HosAuthenticationLogsResponse"
  1610. }
  1611. },
  1612. "default": {
  1613. "description": "Unexpected error.",
  1614. "schema": {
  1615. "$ref": "#/definitions/ErrorResponse"
  1616. }
  1617. }
  1618. }
  1619. }
  1620. },
  1621. "/v1/fleet/hos_logs": {
  1622. "post": {
  1623. "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.",
  1624. "tags": [
  1625. "Fleet"
  1626. ],
  1627. "summary": "/fleet/hos_logs",
  1628. "operationId": "getFleetHosLogs",
  1629. "parameters": [
  1630. {
  1631. "$ref": "#/parameters/accessTokenParam"
  1632. },
  1633. {
  1634. "name": "hosLogsParam",
  1635. "in": "body",
  1636. "required": true,
  1637. "schema": {
  1638. "type": "object",
  1639. "required": [
  1640. "groupId",
  1641. "driverId",
  1642. "startMs",
  1643. "endMs"
  1644. ],
  1645. "properties": {
  1646. "driverId": {
  1647. "description": "Driver ID to query.",
  1648. "type": "integer",
  1649. "format": "int64",
  1650. "example": 444
  1651. },
  1652. "endMs": {
  1653. "description": "End of the time range, specified in milliseconds UNIX time.",
  1654. "type": "integer",
  1655. "example": 1462881998034
  1656. },
  1657. "groupId": {
  1658. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  1659. "type": "integer",
  1660. "format": "int64",
  1661. "example": 101
  1662. },
  1663. "startMs": {
  1664. "description": "Beginning of the time range, specified in milliseconds UNIX time.",
  1665. "type": "integer",
  1666. "example": 1462878398034
  1667. }
  1668. }
  1669. }
  1670. }
  1671. ],
  1672. "responses": {
  1673. "200": {
  1674. "description": "HOS logs for the specified driver.",
  1675. "schema": {
  1676. "$ref": "#/definitions/HosLogsResponse"
  1677. }
  1678. },
  1679. "default": {
  1680. "description": "Unexpected error.",
  1681. "schema": {
  1682. "$ref": "#/definitions/ErrorResponse"
  1683. }
  1684. }
  1685. }
  1686. }
  1687. },
  1688. "/v1/fleet/hos_logs_summary": {
  1689. "get": {
  1690. "description": "Get the current HOS status for all drivers in the group.",
  1691. "tags": [
  1692. "Fleet"
  1693. ],
  1694. "summary": "/fleet/hos_logs_summary",
  1695. "operationId": "getFleetHosLogsSummary",
  1696. "parameters": [
  1697. {
  1698. "$ref": "#/parameters/accessTokenParam"
  1699. },
  1700. {
  1701. "$ref": "#/parameters/groupIdQueryParam"
  1702. }
  1703. ],
  1704. "responses": {
  1705. "200": {
  1706. "description": "HOS logs for the specified driver.",
  1707. "schema": {
  1708. "$ref": "#/definitions/HosLogsSummaryResponse"
  1709. }
  1710. },
  1711. "default": {
  1712. "description": "Unexpected error.",
  1713. "schema": {
  1714. "$ref": "#/definitions/ErrorResponse"
  1715. }
  1716. }
  1717. }
  1718. }
  1719. },
  1720. "/v1/fleet/list": {
  1721. "get": {
  1722. "description": "Get list of the vehicles. This method returns a list of the vehicles in the Samsara Cloud and information about them.",
  1723. "tags": [
  1724. "Fleet"
  1725. ],
  1726. "summary": "/fleet/list",
  1727. "operationId": "listFleet",
  1728. "parameters": [
  1729. {
  1730. "$ref": "#/parameters/accessTokenParam"
  1731. },
  1732. {
  1733. "$ref": "#/parameters/groupIdQueryParam"
  1734. },
  1735. {
  1736. "$ref": "#/parameters/paginationStartingAfterParam"
  1737. },
  1738. {
  1739. "$ref": "#/parameters/paginationEndingBeforeParam"
  1740. },
  1741. {
  1742. "$ref": "#/parameters/paginationLimitParam"
  1743. }
  1744. ],
  1745. "responses": {
  1746. "200": {
  1747. "description": "List of vehicles and information about each.",
  1748. "schema": {
  1749. "type": "object",
  1750. "properties": {
  1751. "groupId": {
  1752. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  1753. "type": "integer",
  1754. "format": "int64",
  1755. "example": 101
  1756. },
  1757. "pagination": {
  1758. "$ref": "#/definitions/Pagination"
  1759. },
  1760. "vehicles": {
  1761. "type": "array",
  1762. "items": {
  1763. "$ref": "#/definitions/Vehicle"
  1764. }
  1765. }
  1766. }
  1767. }
  1768. },
  1769. "default": {
  1770. "description": "Unexpected error.",
  1771. "schema": {
  1772. "$ref": "#/definitions/ErrorResponse"
  1773. }
  1774. }
  1775. }
  1776. }
  1777. },
  1778. "/v1/fleet/locations": {
  1779. "get": {
  1780. "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.",
  1781. "tags": [
  1782. "Fleet"
  1783. ],
  1784. "summary": "/fleet/locations",
  1785. "operationId": "getFleetLocations",
  1786. "parameters": [
  1787. {
  1788. "$ref": "#/parameters/accessTokenParam"
  1789. },
  1790. {
  1791. "$ref": "#/parameters/groupIdQueryParam"
  1792. }
  1793. ],
  1794. "responses": {
  1795. "200": {
  1796. "description": "List of vehicle objects containing their location and the time at which that location was logged.",
  1797. "schema": {
  1798. "type": "object",
  1799. "properties": {
  1800. "groupId": {
  1801. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  1802. "type": "integer",
  1803. "format": "int64",
  1804. "example": 101
  1805. },
  1806. "vehicles": {
  1807. "type": "array",
  1808. "items": {
  1809. "$ref": "#/definitions/VehicleLocation"
  1810. }
  1811. }
  1812. }
  1813. }
  1814. },
  1815. "default": {
  1816. "description": "Unexpected error.",
  1817. "schema": {
  1818. "$ref": "#/definitions/ErrorResponse"
  1819. }
  1820. }
  1821. }
  1822. }
  1823. },
  1824. "/v1/fleet/maintenance/dvirs": {
  1825. "get": {
  1826. "description": "Get DVIRs for the org within provided time constraints",
  1827. "tags": [
  1828. "Fleet"
  1829. ],
  1830. "summary": "/fleet/maintenance/dvirs",
  1831. "operationId": "getDvirs",
  1832. "parameters": [
  1833. {
  1834. "$ref": "#/parameters/accessTokenParam"
  1835. },
  1836. {
  1837. "type": "integer",
  1838. "description": "time in millis until the last dvir log.",
  1839. "name": "end_ms",
  1840. "in": "query",
  1841. "required": true
  1842. },
  1843. {
  1844. "type": "integer",
  1845. "description": "time in millis which corresponds to the duration before the end_ms.",
  1846. "name": "duration_ms",
  1847. "in": "query",
  1848. "required": true
  1849. },
  1850. {
  1851. "$ref": "#/parameters/groupIdQueryParam"
  1852. }
  1853. ],
  1854. "responses": {
  1855. "200": {
  1856. "description": "DVIRs for the specified duration.",
  1857. "schema": {
  1858. "$ref": "#/definitions/DvirListResponse"
  1859. }
  1860. },
  1861. "default": {
  1862. "description": "Unexpected error.",
  1863. "schema": {
  1864. "$ref": "#/definitions/ErrorResponse"
  1865. }
  1866. }
  1867. }
  1868. },
  1869. "post": {
  1870. "description": "Create a new dvir, marking a vehicle or trailer safe or unsafe.",
  1871. "tags": [
  1872. "Fleet"
  1873. ],
  1874. "summary": "/fleet/maintenance/dvirs",
  1875. "operationId": "createDvir",
  1876. "parameters": [
  1877. {
  1878. "$ref": "#/parameters/accessTokenParam"
  1879. },
  1880. {
  1881. "$ref": "#/parameters/createDvirParam"
  1882. }
  1883. ],
  1884. "responses": {
  1885. "200": {
  1886. "description": "Newly created DVIR.",
  1887. "schema": {
  1888. "$ref": "#/definitions/DvirBase"
  1889. }
  1890. },
  1891. "default": {
  1892. "description": "Unexpected error.",
  1893. "schema": {
  1894. "$ref": "#/definitions/ErrorResponse"
  1895. }
  1896. }
  1897. }
  1898. }
  1899. },
  1900. "/v1/fleet/maintenance/list": {
  1901. "get": {
  1902. "description": "Get list of the vehicles with any engine faults or check light data.",
  1903. "tags": [
  1904. "Fleet"
  1905. ],
  1906. "summary": "/fleet/maintenance/list",
  1907. "operationId": "getFleetMaintenanceList",
  1908. "parameters": [
  1909. {
  1910. "$ref": "#/parameters/accessTokenParam"
  1911. },
  1912. {
  1913. "$ref": "#/parameters/groupIdQueryParam"
  1914. }
  1915. ],
  1916. "responses": {
  1917. "200": {
  1918. "description": "List of vehicles and maintenance information about each.",
  1919. "schema": {
  1920. "type": "object",
  1921. "properties": {
  1922. "vehicles": {
  1923. "type": "array",
  1924. "items": {
  1925. "$ref": "#/definitions/VehicleMaintenance"
  1926. }
  1927. }
  1928. }
  1929. }
  1930. },
  1931. "default": {
  1932. "description": "Unexpected error.",
  1933. "schema": {
  1934. "$ref": "#/definitions/ErrorResponse"
  1935. }
  1936. }
  1937. }
  1938. }
  1939. },
  1940. "/v1/fleet/messages": {
  1941. "get": {
  1942. "description": "Get all messages.",
  1943. "consumes": [
  1944. "application/json"
  1945. ],
  1946. "produces": [
  1947. "application/json"
  1948. ],
  1949. "tags": [
  1950. "Messages"
  1951. ],
  1952. "summary": "/fleet/messages",
  1953. "operationId": "getMessages",
  1954. "parameters": [
  1955. {
  1956. "$ref": "#/parameters/getMessagesEndMsParam"
  1957. },
  1958. {
  1959. "$ref": "#/parameters/getMessagesDurationMsParam"
  1960. }
  1961. ],
  1962. "responses": {
  1963. "200": {
  1964. "description": "Returns the fetched messages from most recently sent to least recently sent.",
  1965. "schema": {
  1966. "description": "A list of messages.",
  1967. "type": "object",
  1968. "properties": {
  1969. "data": {
  1970. "$ref": "#/definitions/MessagesResponse"
  1971. }
  1972. }
  1973. }
  1974. },
  1975. "default": {
  1976. "description": "Unexpected error.",
  1977. "schema": {
  1978. "$ref": "#/definitions/ErrorResponse"
  1979. }
  1980. }
  1981. }
  1982. },
  1983. "post": {
  1984. "description": "Send a message to a list of driver ids.",
  1985. "consumes": [
  1986. "application/json"
  1987. ],
  1988. "produces": [
  1989. "application/json"
  1990. ],
  1991. "tags": [
  1992. "Messages"
  1993. ],
  1994. "summary": "/fleet/messages",
  1995. "operationId": "createMessages",
  1996. "parameters": [
  1997. {
  1998. "$ref": "#/parameters/createMessagesParam"
  1999. }
  2000. ],
  2001. "responses": {
  2002. "200": {
  2003. "description": "Returns the created messages.",
  2004. "schema": {
  2005. "description": "A list of created messages.",
  2006. "type": "object",
  2007. "properties": {
  2008. "data": {
  2009. "$ref": "#/definitions/Messages"
  2010. }
  2011. }
  2012. }
  2013. },
  2014. "default": {
  2015. "description": "Unexpected error.",
  2016. "schema": {
  2017. "$ref": "#/definitions/ErrorResponse"
  2018. }
  2019. }
  2020. }
  2021. },
  2022. "parameters": [
  2023. {
  2024. "$ref": "#/parameters/accessTokenParam"
  2025. }
  2026. ]
  2027. },
  2028. "/v1/fleet/set_data": {
  2029. "post": {
  2030. "description": "This API allows you to update metadata for a single vehicle.",
  2031. "tags": [
  2032. "Fleet"
  2033. ],
  2034. "summary": "/fleet/set_data",
  2035. "operationId": "updateVehicles",
  2036. "parameters": [
  2037. {
  2038. "$ref": "#/parameters/accessTokenParam"
  2039. },
  2040. {
  2041. "name": "vehicleUpdateParam",
  2042. "in": "body",
  2043. "required": true,
  2044. "schema": {
  2045. "type": "object",
  2046. "required": [
  2047. "vehicles"
  2048. ],
  2049. "properties": {
  2050. "vehicles": {
  2051. "type": "array",
  2052. "items": {
  2053. "description": "A vehicle object.",
  2054. "type": "object",
  2055. "required": [
  2056. "id"
  2057. ],
  2058. "properties": {
  2059. "id": {
  2060. "$ref": "#/definitions/Vehicle/properties/id"
  2061. },
  2062. "name": {
  2063. "$ref": "#/definitions/Vehicle/properties/name"
  2064. },
  2065. "note": {
  2066. "$ref": "#/definitions/Vehicle/properties/note"
  2067. }
  2068. }
  2069. }
  2070. }
  2071. }
  2072. }
  2073. }
  2074. ],
  2075. "responses": {
  2076. "200": {
  2077. "description": "Vehicles were successfully updated. No response body is returned."
  2078. },
  2079. "default": {
  2080. "description": "Unexpected error.",
  2081. "schema": {
  2082. "$ref": "#/definitions/ErrorResponse"
  2083. }
  2084. }
  2085. }
  2086. }
  2087. },
  2088. "/v1/fleet/trailers/assignments": {
  2089. "get": {
  2090. "description": "Fetch trailer assignment data for all trailers in your organization.",
  2091. "tags": [
  2092. "Fleet"
  2093. ],
  2094. "summary": "/fleet/trailers/assignments",
  2095. "operationId": "getAllTrailerAssignments",
  2096. "parameters": [
  2097. {
  2098. "$ref": "#/parameters/accessTokenParam"
  2099. },
  2100. {
  2101. "type": "integer",
  2102. "format": "int64",
  2103. "description": "Timestamp in Unix epoch miliseconds representing the start of the period to fetch. Omitting both startMs and endMs only returns current assignments.",
  2104. "name": "startMs",
  2105. "in": "query"
  2106. },
  2107. {
  2108. "type": "integer",
  2109. "format": "int64",
  2110. "description": "Timestamp in Unix epoch miliseconds representing the end of the period to fetch. Omitting endMs sets endMs as the current time",
  2111. "name": "endMs",
  2112. "in": "query"
  2113. },
  2114. {
  2115. "$ref": "#/parameters/paginationLimitParam"
  2116. },
  2117. {
  2118. "$ref": "#/parameters/paginationStartingAfterParam"
  2119. },
  2120. {
  2121. "$ref": "#/parameters/paginationEndingBeforeParam"
  2122. }
  2123. ],
  2124. "responses": {
  2125. "200": {
  2126. "description": "Returns trailer assignment data for all trailers in your organization",
  2127. "schema": {
  2128. "type": "object",
  2129. "properties": {
  2130. "pagination": {
  2131. "$ref": "#/definitions/Pagination"
  2132. },
  2133. "trailers": {
  2134. "type": "array",
  2135. "items": {
  2136. "$ref": "#/definitions/TrailerAssignmentsResponse"
  2137. }
  2138. }
  2139. }
  2140. }
  2141. },
  2142. "default": {
  2143. "description": "Unexpected error.",
  2144. "schema": {
  2145. "$ref": "#/definitions/ErrorResponse"
  2146. }
  2147. }
  2148. }
  2149. }
  2150. },
  2151. "/v1/fleet/trailers/{trailerId}/assignments": {
  2152. "get": {
  2153. "description": "Fetch trailer assignment data for a single trailer.",
  2154. "tags": [
  2155. "Fleet"
  2156. ],
  2157. "summary": "/fleet/trailers/{trailerId}/assignments",
  2158. "operationId": "getFleetTrailerAssignments",
  2159. "parameters": [
  2160. {
  2161. "$ref": "#/parameters/accessTokenParam"
  2162. },
  2163. {
  2164. "type": "integer",
  2165. "format": "int64",
  2166. "description": "ID of trailer. Must contain only digits 0-9.",
  2167. "name": "trailerId",
  2168. "in": "path",
  2169. "required": true
  2170. },
  2171. {
  2172. "type": "integer",
  2173. "format": "int64",
  2174. "description": "Timestamp in Unix epoch milliseconds representing the start of the period to fetch. Omitting both startMs and endMs only returns current assignments.",
  2175. "name": "startMs",
  2176. "in": "query"
  2177. },
  2178. {
  2179. "type": "integer",
  2180. "format": "int64",
  2181. "description": "Timestamp in Unix epoch milliseconds representing the end of the period to fetch. Omitting endMs sets endMs as the current time",
  2182. "name": "endMs",
  2183. "in": "query"
  2184. }
  2185. ],
  2186. "responses": {
  2187. "200": {
  2188. "description": "Returns trailer assignment data for a single trailer",
  2189. "schema": {
  2190. "$ref": "#/definitions/TrailerAssignmentsResponse"
  2191. }
  2192. },
  2193. "default": {
  2194. "description": "Unexpected error.",
  2195. "schema": {
  2196. "$ref": "#/definitions/ErrorResponse"
  2197. }
  2198. }
  2199. }
  2200. }
  2201. },
  2202. "/v1/fleet/trips": {
  2203. "get": {
  2204. "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.",
  2205. "tags": [
  2206. "Fleet"
  2207. ],
  2208. "summary": "/fleet/trips",
  2209. "operationId": "getFleetTrips",
  2210. "parameters": [
  2211. {
  2212. "$ref": "#/parameters/accessTokenParam"
  2213. },
  2214. {
  2215. "$ref": "#/parameters/groupIdQueryParam"
  2216. },
  2217. {
  2218. "type": "integer",
  2219. "format": "int64",
  2220. "description": "Vehicle ID to query.",
  2221. "name": "vehicleId",
  2222. "in": "query",
  2223. "required": true
  2224. },
  2225. {
  2226. "type": "integer",
  2227. "description": "Beginning of the time range, specified in milliseconds UNIX time. Limited to a 90 day window with respect to startMs and endMs",
  2228. "name": "startMs",
  2229. "in": "query",
  2230. "required": true
  2231. },
  2232. {
  2233. "type": "integer",
  2234. "description": "End of the time range, specified in milliseconds UNIX time.",
  2235. "name": "endMs",
  2236. "in": "query",
  2237. "required": true
  2238. }
  2239. ],
  2240. "responses": {
  2241. "200": {
  2242. "description": "List of trips taken by the requested vehicle within the specified timeframe.",
  2243. "schema": {
  2244. "$ref": "#/definitions/TripResponse"
  2245. }
  2246. },
  2247. "default": {
  2248. "description": "Unexpected error.",
  2249. "schema": {
  2250. "$ref": "#/definitions/ErrorResponse"
  2251. }
  2252. }
  2253. }
  2254. }
  2255. },
  2256. "/v1/fleet/vehicles/locations": {
  2257. "get": {
  2258. "description": "Fetch locations for all vehicles between a start/end time. The maximum query duration is 30 minutes (1800000 ms).",
  2259. "consumes": [
  2260. "application/json"
  2261. ],
  2262. "produces": [
  2263. "application/json"
  2264. ],
  2265. "tags": [
  2266. "Fleet"
  2267. ],
  2268. "summary": "/fleet/vehicles/locations",
  2269. "operationId": "getVehiclesLocations",
  2270. "responses": {
  2271. "200": {
  2272. "description": "Returns locations for all vehicles between a start/end time, with a maximum query duration of 30 minutes (1800000 ms).",
  2273. "schema": {
  2274. "$ref": "#/definitions/FleetVehiclesLocations"
  2275. }
  2276. },
  2277. "default": {
  2278. "description": "Unexpected error.",
  2279. "schema": {
  2280. "$ref": "#/definitions/ErrorResponse"
  2281. }
  2282. }
  2283. }
  2284. },
  2285. "parameters": [
  2286. {
  2287. "$ref": "#/parameters/accessTokenParam"
  2288. },
  2289. {
  2290. "type": "integer",
  2291. "description": "Time in Unix epoch milliseconds for the start of the query (cannot exceed 30 minutes)",
  2292. "name": "startMs",
  2293. "in": "query",
  2294. "required": true
  2295. },
  2296. {
  2297. "type": "integer",
  2298. "description": "Time in Unix epoch milliseconds for the end of the query (cannot exceed 30 minutes)",
  2299. "name": "endMs",
  2300. "in": "query",
  2301. "required": true
  2302. }
  2303. ]
  2304. },
  2305. "/v1/fleet/vehicles/stats": {
  2306. "get": {
  2307. "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.",
  2308. "tags": [
  2309. "Fleet"
  2310. ],
  2311. "summary": "/fleet/vehicles/stats",
  2312. "operationId": "getVehicleStats",
  2313. "parameters": [
  2314. {
  2315. "$ref": "#/parameters/accessTokenParam"
  2316. },
  2317. {
  2318. "type": "integer",
  2319. "description": "Time in Unix epoch milliseconds for the start of the query.",
  2320. "name": "startMs",
  2321. "in": "query",
  2322. "required": true
  2323. },
  2324. {
  2325. "type": "integer",
  2326. "description": "Time in Unix epoch milliseconds for the end of the query.",
  2327. "name": "endMs",
  2328. "in": "query",
  2329. "required": true
  2330. },
  2331. {
  2332. "enum": [
  2333. "engineState",
  2334. "auxInput1",
  2335. "auxInput2"
  2336. ],
  2337. "type": "string",
  2338. "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",
  2339. "name": "series",
  2340. "in": "query"
  2341. },
  2342. {
  2343. "type": "string",
  2344. "description": "Comma-separated list of tag ids. Example: tagIds=1,2,3",
  2345. "name": "tagIds",
  2346. "in": "query"
  2347. },
  2348. {
  2349. "$ref": "#/parameters/paginationStartingAfterParam"
  2350. },
  2351. {
  2352. "$ref": "#/parameters/paginationEndingBeforeParam"
  2353. },
  2354. {
  2355. "$ref": "#/parameters/paginationLimitParam"
  2356. }
  2357. ],
  2358. "responses": {
  2359. "200": {
  2360. "description": "Returns engine state and/or aux input data for all vehicles in the group between a start/end time.",
  2361. "schema": {
  2362. "type": "object",
  2363. "required": [
  2364. "vehicleStats"
  2365. ],
  2366. "properties": {
  2367. "pagination": {
  2368. "$ref": "#/definitions/Pagination"
  2369. },
  2370. "vehicleStats": {
  2371. "type": "array",
  2372. "items": {
  2373. "type": "object",
  2374. "required": [
  2375. "vehicleId"
  2376. ],
  2377. "properties": {
  2378. "auxInput1": {
  2379. "$ref": "#/definitions/AuxInputSeries"
  2380. },
  2381. "auxInput2": {
  2382. "$ref": "#/definitions/AuxInputSeries"
  2383. },
  2384. "engineState": {
  2385. "type": "array",
  2386. "items": {
  2387. "$ref": "#/definitions/EngineState"
  2388. }
  2389. },
  2390. "externalIds": {
  2391. "description": "Dictionary of external IDs (string key-value pairs)",
  2392. "type": "object",
  2393. "additionalProperties": {
  2394. "type": "string"
  2395. },
  2396. "example": {
  2397. "maintenanceId": "250020",
  2398. "vehicleNumber": "ABFS18600"
  2399. }
  2400. },
  2401. "vehicleId": {
  2402. "description": "ID of the vehicle.",
  2403. "type": "integer",
  2404. "format": "int64",
  2405. "example": 112
  2406. }
  2407. }
  2408. }
  2409. }
  2410. }
  2411. }
  2412. },
  2413. "default": {
  2414. "description": "Unexpected error.",
  2415. "schema": {
  2416. "$ref": "#/definitions/ErrorResponse"
  2417. }
  2418. }
  2419. }
  2420. }
  2421. },
  2422. "/v1/fleet/vehicles/{vehicleId}/safety/harsh_event": {
  2423. "get": {
  2424. "description": "Fetch harsh event details for a vehicle.",
  2425. "tags": [
  2426. "Fleet",
  2427. "Safety"
  2428. ],
  2429. "summary": "/fleet/vehicles/{vehicleId}/safety/harsh_event",
  2430. "operationId": "getVehicleHarshEvent",
  2431. "parameters": [
  2432. {
  2433. "$ref": "#/parameters/accessTokenParam"
  2434. },
  2435. {
  2436. "$ref": "#/parameters/harshEventMsParam"
  2437. }
  2438. ],
  2439. "responses": {
  2440. "200": {
  2441. "description": "Harsh event details.",
  2442. "schema": {
  2443. "$ref": "#/definitions/VehicleHarshEventResponse"
  2444. }
  2445. },
  2446. "default": {
  2447. "description": "Unexpected error.",
  2448. "schema": {
  2449. "$ref": "#/definitions/ErrorResponse"
  2450. }
  2451. }
  2452. }
  2453. },
  2454. "parameters": [
  2455. {
  2456. "type": "integer",
  2457. "format": "int64",
  2458. "description": "ID of the vehicle. Must contain only digits 0-9.",
  2459. "name": "vehicleId",
  2460. "in": "path",
  2461. "required": true
  2462. }
  2463. ]
  2464. },
  2465. "/v1/fleet/vehicles/{vehicleId}/safety/score": {
  2466. "get": {
  2467. "description": "Fetch the safety score for the vehicle.",
  2468. "tags": [
  2469. "Fleet",
  2470. "Safety"
  2471. ],
  2472. "summary": "/fleet/vehicles/{vehicleId}/safety/score",
  2473. "operationId": "getVehicleSafetyScore",
  2474. "parameters": [
  2475. {
  2476. "$ref": "#/parameters/accessTokenParam"
  2477. },
  2478. {
  2479. "$ref": "#/parameters/safetyScoreStartMsParam"
  2480. },
  2481. {
  2482. "$ref": "#/parameters/safetyScoreEndMsParam"
  2483. },
  2484. {
  2485. "$ref": "#/parameters/groupIdQueryParam"
  2486. }
  2487. ],
  2488. "responses": {
  2489. "200": {
  2490. "description": "Safety score details.",
  2491. "schema": {
  2492. "$ref": "#/definitions/VehicleSafetyScoreResponse"
  2493. }
  2494. },
  2495. "default": {
  2496. "description": "Unexpected error.",
  2497. "schema": {
  2498. "$ref": "#/definitions/ErrorResponse"
  2499. }
  2500. }
  2501. }
  2502. },
  2503. "parameters": [
  2504. {
  2505. "type": "integer",
  2506. "format": "int64",
  2507. "description": "ID of the vehicle. Must contain only digits 0-9.",
  2508. "name": "vehicleId",
  2509. "in": "path",
  2510. "required": true
  2511. }
  2512. ]
  2513. },
  2514. "/v1/fleet/vehicles/{vehicle_id_or_external_id}": {
  2515. "get": {
  2516. "description": "Gets a specific vehicle.",
  2517. "consumes": [
  2518. "application/json"
  2519. ],
  2520. "tags": [
  2521. "Fleet"
  2522. ],
  2523. "summary": "/fleet/vehicles/{vehicle_id or external_id}",
  2524. "operationId": "getFleetVehicle",
  2525. "parameters": [
  2526. {
  2527. "$ref": "#/parameters/accessTokenParam"
  2528. },
  2529. {
  2530. "$ref": "#/parameters/vehicleIdOrExternalIdParam"
  2531. }
  2532. ],
  2533. "responses": {
  2534. "200": {
  2535. "description": "The specified vehicle.",
  2536. "schema": {
  2537. "$ref": "#/definitions/FleetVehicleResponse"
  2538. }
  2539. },
  2540. "default": {
  2541. "description": "Unexpected error.",
  2542. "schema": {
  2543. "$ref": "#/definitions/ErrorResponse"
  2544. }
  2545. }
  2546. }
  2547. },
  2548. "patch": {
  2549. "description": "Updates the specified vehicle using JSON merge patch format. See IETF RFC 7396: https://tools.ietf.org/html/rfc7396.",
  2550. "consumes": [
  2551. "application/json",
  2552. "application/merge-patch+json"
  2553. ],
  2554. "tags": [
  2555. "Fleet"
  2556. ],
  2557. "summary": "/fleet/vehicles/{vehicle_id or external_id}",
  2558. "operationId": "patchFleetVehicle",
  2559. "parameters": [
  2560. {
  2561. "$ref": "#/parameters/accessTokenParam"
  2562. },
  2563. {
  2564. "$ref": "#/parameters/vehicleIdOrExternalIdParam"
  2565. },
  2566. {
  2567. "name": "data",
  2568. "in": "body",
  2569. "required": true,
  2570. "schema": {
  2571. "type": "object",
  2572. "properties": {
  2573. "externalIds": {
  2574. "type": "object",
  2575. "additionalProperties": {
  2576. "type": "string"
  2577. },
  2578. "example": {
  2579. "maintenanceId": "ABFS18600"
  2580. }
  2581. },
  2582. "harsh_accel_setting": {
  2583. "description": "Harsh Event Detection Setting\n* 0: Passenger\n* 1: Light Truck\n* 2: Heavy\n* 3: Off\n* 4: Automatic",
  2584. "type": "integer",
  2585. "format": "string",
  2586. "enum": [
  2587. "Passenger",
  2588. "Light Truck",
  2589. "Heavy",
  2590. "Off",
  2591. "Auto"
  2592. ]
  2593. },
  2594. "name": {
  2595. "description": "Name",
  2596. "type": "string"
  2597. }
  2598. }
  2599. }
  2600. }
  2601. ],
  2602. "responses": {
  2603. "200": {
  2604. "description": "The updated vehicle.",
  2605. "schema": {
  2606. "$ref": "#/definitions/FleetVehicleResponse"
  2607. }
  2608. },
  2609. "default": {
  2610. "description": "Unexpected error.",
  2611. "schema": {
  2612. "$ref": "#/definitions/ErrorResponse"
  2613. }
  2614. }
  2615. }
  2616. }
  2617. },
  2618. "/v1/fleet/vehicles/{vehicle_id}/dispatch/routes": {
  2619. "get": {
  2620. "description": "Fetch all of the dispatch routes for a given vehicle.",
  2621. "consumes": [
  2622. "application/json"
  2623. ],
  2624. "produces": [
  2625. "application/json"
  2626. ],
  2627. "tags": [
  2628. "Fleet",
  2629. "Routes"
  2630. ],
  2631. "summary": "/fleet/vehicles/{vehicle_id}/dispatch/routes",
  2632. "operationId": "getDispatchRoutesByVehicleId",
  2633. "parameters": [
  2634. {
  2635. "$ref": "#/parameters/routeEndTimeParam"
  2636. },
  2637. {
  2638. "$ref": "#/parameters/routeDurationParam"
  2639. }
  2640. ],
  2641. "responses": {
  2642. "200": {
  2643. "description": "Returns all of the dispatch routes for the given vehicle_id.",
  2644. "schema": {
  2645. "$ref": "#/definitions/DispatchRoutes"
  2646. }
  2647. },
  2648. "default": {
  2649. "description": "Unexpected error.",
  2650. "schema": {
  2651. "$ref": "#/definitions/ErrorResponse"
  2652. }
  2653. }
  2654. }
  2655. },
  2656. "post": {
  2657. "description": "Create a new dispatch route for the vehicle with vehicle_id.",
  2658. "consumes": [
  2659. "application/json"
  2660. ],
  2661. "produces": [
  2662. "application/json"
  2663. ],
  2664. "tags": [
  2665. "Fleet",
  2666. "Routes"
  2667. ],
  2668. "summary": "/fleet/vehicles/{vehicle_id}/dispatch/routes",
  2669. "operationId": "createVehicleDispatchRoute",
  2670. "parameters": [
  2671. {
  2672. "$ref": "#/parameters/routeCreateParam"
  2673. }
  2674. ],
  2675. "responses": {
  2676. "200": {
  2677. "description": "Created route object including the new route ID.",
  2678. "schema": {
  2679. "$ref": "#/definitions/DispatchRoute"
  2680. }
  2681. },
  2682. "default": {
  2683. "description": "Unexpected error.",
  2684. "schema": {
  2685. "$ref": "#/definitions/ErrorResponse"
  2686. }
  2687. }
  2688. }
  2689. },
  2690. "parameters": [
  2691. {
  2692. "$ref": "#/parameters/accessTokenParam"
  2693. },
  2694. {
  2695. "type": "integer",
  2696. "format": "int64",
  2697. "description": "ID of the vehicle with the associated routes. Must contain only digits 0-9.",
  2698. "name": "vehicle_id",
  2699. "in": "path",
  2700. "required": true
  2701. }
  2702. ]
  2703. },
  2704. "/v1/fleet/vehicles/{vehicle_id}/locations": {
  2705. "get": {
  2706. "description": "Fetch locations for a given vehicle between a start/end time. The maximum query duration is one hour.",
  2707. "consumes": [
  2708. "application/json"
  2709. ],
  2710. "produces": [
  2711. "application/json"
  2712. ],
  2713. "tags": [
  2714. "Fleet"
  2715. ],
  2716. "summary": "/fleet/vehicles/{vehicle_id}/locations",
  2717. "operationId": "getVehicleLocations",
  2718. "responses": {
  2719. "200": {
  2720. "description": "Returns locations for a given vehicle between a start/end time, with a maximum query duration of one hour.",
  2721. "schema": {
  2722. "$ref": "#/definitions/FleetVehicleLocations"
  2723. }
  2724. },
  2725. "default": {
  2726. "description": "Unexpected error.",
  2727. "schema": {
  2728. "$ref": "#/definitions/ErrorResponse"
  2729. }
  2730. }
  2731. }
  2732. },
  2733. "parameters": [
  2734. {
  2735. "$ref": "#/parameters/accessTokenParam"
  2736. },
  2737. {
  2738. "type": "integer",
  2739. "format": "int64",
  2740. "description": "ID of the vehicle with the associated routes. Must contain only digits 0-9.",
  2741. "name": "vehicle_id",
  2742. "in": "path",
  2743. "required": true
  2744. },
  2745. {
  2746. "type": "integer",
  2747. "format": "int64",
  2748. "description": "Time in Unix epoch milliseconds for the start of the query (cannot exceed 1 hour)",
  2749. "name": "startMs",
  2750. "in": "query",
  2751. "required": true
  2752. },
  2753. {
  2754. "type": "integer",
  2755. "format": "int64",
  2756. "description": "Time in Unix epoch milliseconds for the end of the query (cannot exceed 1 hour)",
  2757. "name": "endMs",
  2758. "in": "query",
  2759. "required": true
  2760. }
  2761. ]
  2762. },
  2763. "/v1/industrial/data": {
  2764. "get": {
  2765. "description": "Fetch all of the data inputs for a group.",
  2766. "consumes": [
  2767. "application/json"
  2768. ],
  2769. "produces": [
  2770. "application/json"
  2771. ],
  2772. "tags": [
  2773. "Industrial"
  2774. ],
  2775. "summary": "/industrial/data",
  2776. "operationId": "getAllDataInputs",
  2777. "parameters": [
  2778. {
  2779. "$ref": "#/parameters/accessTokenParam"
  2780. },
  2781. {
  2782. "$ref": "#/parameters/groupIdParam"
  2783. },
  2784. {
  2785. "$ref": "#/parameters/dataInputStartTimeParam"
  2786. },
  2787. {
  2788. "$ref": "#/parameters/dataInputEndTimeParam"
  2789. }
  2790. ],
  2791. "responses": {
  2792. "200": {
  2793. "description": "List of data inputs.",
  2794. "schema": {
  2795. "type": "object",
  2796. "properties": {
  2797. "dataInputs": {
  2798. "type": "array",
  2799. "items": {
  2800. "$ref": "#/definitions/DataInputHistoryResponse"
  2801. }
  2802. }
  2803. }
  2804. }
  2805. },
  2806. "default": {
  2807. "description": "Unexpected error.",
  2808. "schema": {
  2809. "$ref": "#/definitions/ErrorResponse"
  2810. }
  2811. }
  2812. }
  2813. }
  2814. },
  2815. "/v1/industrial/data/{data_input_id}": {
  2816. "get": {
  2817. "description": "Fetch datapoints from a given data input.",
  2818. "consumes": [
  2819. "application/json"
  2820. ],
  2821. "produces": [
  2822. "application/json"
  2823. ],
  2824. "tags": [
  2825. "Industrial"
  2826. ],
  2827. "summary": "/industrial/data/{data_input_id}",
  2828. "operationId": "getDataInput",
  2829. "parameters": [
  2830. {
  2831. "$ref": "#/parameters/accessTokenParam"
  2832. },
  2833. {
  2834. "$ref": "#/parameters/dataInputIdParam"
  2835. },
  2836. {
  2837. "$ref": "#/parameters/dataInputStartTimeParam"
  2838. },
  2839. {
  2840. "$ref": "#/parameters/dataInputEndTimeParam"
  2841. }
  2842. ],
  2843. "responses": {
  2844. "200": {
  2845. "description": "Returns datapoints for the given data input",
  2846. "schema": {
  2847. "$ref": "#/definitions/DataInputHistoryResponse"
  2848. }
  2849. },
  2850. "default": {
  2851. "description": "Unexpected error.",
  2852. "schema": {
  2853. "$ref": "#/definitions/ErrorResponse"
  2854. }
  2855. }
  2856. }
  2857. }
  2858. },
  2859. "/v1/industrial/vision/cameras": {
  2860. "get": {
  2861. "description": "Fetch all cameras.",
  2862. "consumes": [
  2863. "application/json"
  2864. ],
  2865. "produces": [
  2866. "application/json"
  2867. ],
  2868. "tags": [
  2869. "Industrial"
  2870. ],
  2871. "summary": "/industrial/vision/cameras",
  2872. "operationId": "getCameras",
  2873. "parameters": [
  2874. {
  2875. "$ref": "#/parameters/accessTokenParam"
  2876. }
  2877. ],
  2878. "responses": {
  2879. "200": {
  2880. "description": "Returns details about a camera.",
  2881. "schema": {
  2882. "$ref": "#/definitions/VisionCamerasResponse"
  2883. }
  2884. },
  2885. "default": {
  2886. "description": "Unexpected error.",
  2887. "schema": {
  2888. "$ref": "#/definitions/ErrorResponse"
  2889. }
  2890. }
  2891. }
  2892. }
  2893. },
  2894. "/v1/industrial/vision/cameras/{camera_id}/programs": {
  2895. "get": {
  2896. "description": "Fetch configured programs on the camera.",
  2897. "consumes": [
  2898. "application/json"
  2899. ],
  2900. "produces": [
  2901. "application/json"
  2902. ],
  2903. "tags": [
  2904. "Industrial"
  2905. ],
  2906. "summary": "/industrial/vision/cameras/{camera_id}/programs",
  2907. "operationId": "getVisionProgramsByCamera",
  2908. "parameters": [
  2909. {
  2910. "$ref": "#/parameters/accessTokenParam"
  2911. },
  2912. {
  2913. "$ref": "#/parameters/visionCameraIdParam"
  2914. }
  2915. ],
  2916. "responses": {
  2917. "200": {
  2918. "description": "Returns programs configured on the camera.",
  2919. "schema": {
  2920. "$ref": "#/definitions/ProgramsForTheCameraResponse"
  2921. }
  2922. },
  2923. "default": {
  2924. "description": "Unexpected error.",
  2925. "schema": {
  2926. "$ref": "#/definitions/ErrorResponse"
  2927. }
  2928. }
  2929. }
  2930. }
  2931. },
  2932. "/v1/industrial/vision/run/camera/{camera_id}": {
  2933. "get": {
  2934. "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.",
  2935. "consumes": [
  2936. "application/json"
  2937. ],
  2938. "produces": [
  2939. "application/json"
  2940. ],
  2941. "tags": [
  2942. "Industrial"
  2943. ],
  2944. "summary": "/industrial/vision/run/camera/{camera_id}",
  2945. "operationId": "getVisionLatestRunCamera",
  2946. "parameters": [
  2947. {
  2948. "$ref": "#/parameters/accessTokenParam"
  2949. },
  2950. {
  2951. "$ref": "#/parameters/visionCameraIdParam"
  2952. },
  2953. {
  2954. "$ref": "#/parameters/visionProgramIdParam"
  2955. },
  2956. {
  2957. "$ref": "#/parameters/visionStartAtMsParam"
  2958. },
  2959. {
  2960. "$ref": "#/parameters/visionIncludeParam"
  2961. },
  2962. {
  2963. "$ref": "#/parameters/visionLimitParam"
  2964. }
  2965. ],
  2966. "responses": {
  2967. "200": {
  2968. "description": "Returns the details for this run.",
  2969. "schema": {
  2970. "$ref": "#/definitions/VisionRunByCameraResponse"
  2971. }
  2972. },
  2973. "default": {
  2974. "description": "Unexpected error.",
  2975. "schema": {
  2976. "$ref": "#/definitions/ErrorResponse"
  2977. }
  2978. }
  2979. }
  2980. }
  2981. },
  2982. "/v1/industrial/vision/runs": {
  2983. "get": {
  2984. "description": "Fetch runs.",
  2985. "consumes": [
  2986. "application/json"
  2987. ],
  2988. "produces": [
  2989. "application/json"
  2990. ],
  2991. "tags": [
  2992. "Industrial"
  2993. ],
  2994. "summary": "/industrial/vision/runs",
  2995. "operationId": "getVisionRuns",
  2996. "parameters": [
  2997. {
  2998. "$ref": "#/parameters/accessTokenParam"
  2999. },
  3000. {
  3001. "$ref": "#/parameters/visionDurationMsParam"
  3002. },
  3003. {
  3004. "$ref": "#/parameters/visionEndMsParam"
  3005. }
  3006. ],
  3007. "responses": {
  3008. "200": {
  3009. "description": "Return runs.",
  3010. "schema": {
  3011. "$ref": "#/definitions/VisionRunsResponse"
  3012. }
  3013. },
  3014. "default": {
  3015. "description": "Unexpected error.",
  3016. "schema": {
  3017. "$ref": "#/definitions/ErrorResponse"
  3018. }
  3019. }
  3020. }
  3021. }
  3022. },
  3023. "/v1/industrial/vision/runs/{camera_id}": {
  3024. "get": {
  3025. "description": "Fetch runs by camera.",
  3026. "consumes": [
  3027. "application/json"
  3028. ],
  3029. "produces": [
  3030. "application/json"
  3031. ],
  3032. "tags": [
  3033. "Industrial"
  3034. ],
  3035. "summary": "/industrial/vision/runs/{camera_id}",
  3036. "operationId": "getVisionRunsByCamera",
  3037. "parameters": [
  3038. {
  3039. "$ref": "#/parameters/accessTokenParam"
  3040. },
  3041. {
  3042. "$ref": "#/parameters/visionCameraIdParam"
  3043. },
  3044. {
  3045. "$ref": "#/parameters/visionDurationMsParam"
  3046. },
  3047. {
  3048. "$ref": "#/parameters/visionEndMsParam"
  3049. }
  3050. ],
  3051. "responses": {
  3052. "200": {
  3053. "description": "Return runs by cameraId.",
  3054. "schema": {
  3055. "$ref": "#/definitions/VisionRunsByCameraResponse"
  3056. }
  3057. },
  3058. "default": {
  3059. "description": "Unexpected error.",
  3060. "schema": {
  3061. "$ref": "#/definitions/ErrorResponse"
  3062. }
  3063. }
  3064. }
  3065. }
  3066. },
  3067. "/v1/machines/history": {
  3068. "post": {
  3069. "description": "Get historical data for machine objects. This method returns a set of historical data for all machines in a group",
  3070. "tags": [
  3071. "Industrial"
  3072. ],
  3073. "summary": "/machines/history",
  3074. "operationId": "getMachinesHistory",
  3075. "parameters": [
  3076. {
  3077. "$ref": "#/parameters/accessTokenParam"
  3078. },
  3079. {
  3080. "description": "Group ID and time range to query for events",
  3081. "name": "historyParam",
  3082. "in": "body",
  3083. "required": true,
  3084. "schema": {
  3085. "type": "object",
  3086. "required": [
  3087. "groupId",
  3088. "startMs",
  3089. "endMs"
  3090. ],
  3091. "properties": {
  3092. "endMs": {
  3093. "description": "End of the time range, specified in milliseconds UNIX time.",
  3094. "type": "integer",
  3095. "example": 1462881998034
  3096. },
  3097. "groupId": {
  3098. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  3099. "type": "integer",
  3100. "format": "int64",
  3101. "example": 101
  3102. },
  3103. "startMs": {
  3104. "description": "Beginning of the time range, specified in milliseconds UNIX time.",
  3105. "type": "integer",
  3106. "example": 1462878398034
  3107. }
  3108. }
  3109. }
  3110. }
  3111. ],
  3112. "responses": {
  3113. "200": {
  3114. "description": "List of machine results objects, each containing a time and a datapoint.",
  3115. "schema": {
  3116. "$ref": "#/definitions/MachineHistoryResponse"
  3117. }
  3118. },
  3119. "default": {
  3120. "description": "Unexpected error.",
  3121. "schema": {
  3122. "$ref": "#/definitions/ErrorResponse"
  3123. }
  3124. }
  3125. }
  3126. }
  3127. },
  3128. "/v1/machines/list": {
  3129. "post": {
  3130. "description": "Get machine objects. This method returns a list of the machine objects in the Samsara Cloud and information about them.",
  3131. "tags": [
  3132. "Industrial"
  3133. ],
  3134. "summary": "/machines/list",
  3135. "operationId": "getMachines",
  3136. "parameters": [
  3137. {
  3138. "$ref": "#/parameters/accessTokenParam"
  3139. },
  3140. {
  3141. "$ref": "#/parameters/groupIdBodyParam"
  3142. }
  3143. ],
  3144. "responses": {
  3145. "200": {
  3146. "description": "List of machine objects.",
  3147. "schema": {
  3148. "type": "object",
  3149. "properties": {
  3150. "machines": {
  3151. "type": "array",
  3152. "items": {
  3153. "$ref": "#/definitions/Machine"
  3154. }
  3155. }
  3156. }
  3157. }
  3158. },
  3159. "default": {
  3160. "description": "Unexpected error.",
  3161. "schema": {
  3162. "$ref": "#/definitions/ErrorResponse"
  3163. }
  3164. }
  3165. }
  3166. }
  3167. },
  3168. "/v1/sensors/cargo": {
  3169. "post": {
  3170. "description": "Get cargo monitor status (empty / full) for requested sensors.",
  3171. "tags": [
  3172. "Sensors"
  3173. ],
  3174. "summary": "/sensors/cargo",
  3175. "operationId": "getSensorsCargo",
  3176. "parameters": [
  3177. {
  3178. "$ref": "#/parameters/accessTokenParam"
  3179. },
  3180. {
  3181. "$ref": "#/parameters/sensorParam"
  3182. }
  3183. ],
  3184. "responses": {
  3185. "200": {
  3186. "description": "List of sensor objects containing the current cargo status reported by each sensor.",
  3187. "schema": {
  3188. "$ref": "#/definitions/CargoResponse"
  3189. }
  3190. },
  3191. "default": {
  3192. "description": "Unexpected error.",
  3193. "schema": {
  3194. "$ref": "#/definitions/ErrorResponse"
  3195. }
  3196. }
  3197. }
  3198. }
  3199. },
  3200. "/v1/sensors/door": {
  3201. "post": {
  3202. "description": "Get door monitor status (closed / open) for requested sensors.",
  3203. "tags": [
  3204. "Sensors"
  3205. ],
  3206. "summary": "/sensors/door",
  3207. "operationId": "getSensorsDoor",
  3208. "parameters": [
  3209. {
  3210. "$ref": "#/parameters/accessTokenParam"
  3211. },
  3212. {
  3213. "$ref": "#/parameters/sensorParam"
  3214. }
  3215. ],
  3216. "responses": {
  3217. "200": {
  3218. "description": "List of sensor objects containing the current door status reported by each sensor.",
  3219. "schema": {
  3220. "$ref": "#/definitions/DoorResponse"
  3221. }
  3222. },
  3223. "default": {
  3224. "description": "Unexpected error.",
  3225. "schema": {
  3226. "$ref": "#/definitions/ErrorResponse"
  3227. }
  3228. }
  3229. }
  3230. }
  3231. },
  3232. "/v1/sensors/history": {
  3233. "post": {
  3234. "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.",
  3235. "tags": [
  3236. "Sensors"
  3237. ],
  3238. "summary": "/sensors/history",
  3239. "operationId": "getSensorsHistory",
  3240. "parameters": [
  3241. {
  3242. "$ref": "#/parameters/accessTokenParam"
  3243. },
  3244. {
  3245. "description": "Group ID, time range and resolution, and list of sensor ID, field pairs to query.",
  3246. "name": "historyParam",
  3247. "in": "body",
  3248. "required": true,
  3249. "schema": {
  3250. "type": "object",
  3251. "required": [
  3252. "groupId",
  3253. "startMs",
  3254. "endMs",
  3255. "stepMs",
  3256. "series"
  3257. ],
  3258. "properties": {
  3259. "endMs": {
  3260. "description": "End of the time range, specified in milliseconds UNIX time.",
  3261. "type": "integer",
  3262. "example": 1462881998034
  3263. },
  3264. "fillMissing": {
  3265. "type": "string",
  3266. "default": "withNull",
  3267. "enum": [
  3268. "withNull",
  3269. "withPrevious"
  3270. ]
  3271. },
  3272. "groupId": {
  3273. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  3274. "type": "integer",
  3275. "format": "int64",
  3276. "example": 101
  3277. },
  3278. "series": {
  3279. "type": "array",
  3280. "items": {
  3281. "description": "Sensor ID and field to query.",
  3282. "type": "object",
  3283. "required": [
  3284. "widgetId",
  3285. "field"
  3286. ],
  3287. "properties": {
  3288. "field": {
  3289. "description": "Field to query.",
  3290. "type": "string",
  3291. "enum": [
  3292. "ambientTemperature",
  3293. "cargoPercent",
  3294. "currentLoop1Raw",
  3295. "currentLoop1Mapped",
  3296. "currentLoop2Raw",
  3297. "currentLoop2Mapped",
  3298. "doorClosed",
  3299. "humidity",
  3300. "pmPowerTotal",
  3301. "pmPhase1Power",
  3302. "pmPhase2Power",
  3303. "pmPhase3Power",
  3304. "pmPhase1PowerFactor",
  3305. "pmPhase2PowerFactor",
  3306. "pmPhase3PowerFactor",
  3307. "probeTemperature"
  3308. ],
  3309. "example": "ambientTemperature"
  3310. },
  3311. "widgetId": {
  3312. "description": "Sensor ID to query.",
  3313. "type": "integer",
  3314. "format": "int64",
  3315. "example": 1
  3316. }
  3317. }
  3318. }
  3319. },
  3320. "startMs": {
  3321. "description": "Beginning of the time range, specified in milliseconds UNIX time.",
  3322. "type": "integer",
  3323. "example": 1462878398034
  3324. },
  3325. "stepMs": {
  3326. "description": "Time resolution for which data should be returned, in milliseconds. Specifying 3600000 will return data at hour intervals.",
  3327. "type": "integer",
  3328. "example": 3600000
  3329. }
  3330. }
  3331. }
  3332. }
  3333. ],
  3334. "responses": {
  3335. "200": {
  3336. "description": "List of results objects, each containing a time and a datapoint for each requested sensor/field pair.",
  3337. "schema": {
  3338. "$ref": "#/definitions/SensorHistoryResponse"
  3339. }
  3340. },
  3341. "default": {
  3342. "description": "Unexpected error.",
  3343. "schema": {
  3344. "$ref": "#/definitions/ErrorResponse"
  3345. }
  3346. }
  3347. }
  3348. }
  3349. },
  3350. "/v1/sensors/humidity": {
  3351. "post": {
  3352. "description": "Get humidity for requested sensors. This method returns the current relative humidity for the requested sensors.",
  3353. "tags": [
  3354. "Sensors"
  3355. ],
  3356. "summary": "/sensors/humidity",
  3357. "operationId": "getSensorsHumidity",
  3358. "parameters": [
  3359. {
  3360. "$ref": "#/parameters/accessTokenParam"
  3361. },
  3362. {
  3363. "$ref": "#/parameters/sensorParam"
  3364. }
  3365. ],
  3366. "responses": {
  3367. "200": {
  3368. "description": "List of sensor objects containing the current humidity reported by each sensor.",
  3369. "schema": {
  3370. "$ref": "#/definitions/HumidityResponse"
  3371. }
  3372. },
  3373. "default": {
  3374. "description": "Unexpected error.",
  3375. "schema": {
  3376. "$ref": "#/definitions/ErrorResponse"
  3377. }
  3378. }
  3379. }
  3380. }
  3381. },
  3382. "/v1/sensors/list": {
  3383. "post": {
  3384. "description": "Get sensor objects. This method returns a list of the sensor objects in the Samsara Cloud and information about them.",
  3385. "tags": [
  3386. "Sensors"
  3387. ],
  3388. "summary": "/sensors/list",
  3389. "operationId": "getSensors",
  3390. "parameters": [
  3391. {
  3392. "$ref": "#/parameters/accessTokenParam"
  3393. },
  3394. {
  3395. "$ref": "#/parameters/groupIdBodyParam"
  3396. }
  3397. ],
  3398. "responses": {
  3399. "200": {
  3400. "description": "List of sensor objects.",
  3401. "schema": {
  3402. "type": "object",
  3403. "properties": {
  3404. "sensors": {
  3405. "type": "array",
  3406. "items": {
  3407. "$ref": "#/definitions/Sensor"
  3408. }
  3409. }
  3410. }
  3411. }
  3412. },
  3413. "default": {
  3414. "description": "Unexpected error.",
  3415. "schema": {
  3416. "$ref": "#/definitions/ErrorResponse"
  3417. }
  3418. }
  3419. }
  3420. }
  3421. },
  3422. "/v1/sensors/temperature": {
  3423. "post": {
  3424. "description": "Get temperature for requested sensors. This method returns the current ambient temperature (and probe temperature if applicable) for the requested sensors.",
  3425. "tags": [
  3426. "Sensors"
  3427. ],
  3428. "summary": "/sensors/temperature",
  3429. "operationId": "getSensorsTemperature",
  3430. "parameters": [
  3431. {
  3432. "$ref": "#/parameters/accessTokenParam"
  3433. },
  3434. {
  3435. "$ref": "#/parameters/sensorParam"
  3436. }
  3437. ],
  3438. "responses": {
  3439. "200": {
  3440. "description": "List of sensor objects containing the current temperature reported by each sensor.",
  3441. "schema": {
  3442. "$ref": "#/definitions/TemperatureResponse"
  3443. }
  3444. },
  3445. "default": {
  3446. "description": "Unexpected error.",
  3447. "schema": {
  3448. "$ref": "#/definitions/ErrorResponse"
  3449. }
  3450. }
  3451. }
  3452. }
  3453. },
  3454. "/v1/tags": {
  3455. "get": {
  3456. "description": "Fetch all of the tags for a group.",
  3457. "consumes": [
  3458. "application/json"
  3459. ],
  3460. "produces": [
  3461. "application/json"
  3462. ],
  3463. "tags": [
  3464. "Tags"
  3465. ],
  3466. "summary": "/tags",
  3467. "operationId": "getAllTags",
  3468. "parameters": [
  3469. {
  3470. "$ref": "#/parameters/accessTokenParam"
  3471. },
  3472. {
  3473. "$ref": "#/parameters/groupIdQueryParam"
  3474. }
  3475. ],
  3476. "responses": {
  3477. "200": {
  3478. "description": "List of tags.",
  3479. "schema": {
  3480. "type": "object",
  3481. "properties": {
  3482. "tags": {
  3483. "type": "array",
  3484. "items": {
  3485. "$ref": "#/definitions/Tag"
  3486. }
  3487. }
  3488. }
  3489. }
  3490. },
  3491. "default": {
  3492. "description": "Unexpected error.",
  3493. "schema": {
  3494. "$ref": "#/definitions/ErrorResponse"
  3495. }
  3496. }
  3497. }
  3498. },
  3499. "post": {
  3500. "description": "Create a new tag for the group.",
  3501. "consumes": [
  3502. "application/json"
  3503. ],
  3504. "produces": [
  3505. "application/json"
  3506. ],
  3507. "tags": [
  3508. "Tags"
  3509. ],
  3510. "summary": "/tags",
  3511. "operationId": "createTag",
  3512. "parameters": [
  3513. {
  3514. "$ref": "#/parameters/accessTokenParam"
  3515. },
  3516. {
  3517. "$ref": "#/parameters/tagCreateParam"
  3518. }
  3519. ],
  3520. "responses": {
  3521. "200": {
  3522. "description": "Newly created tag object, including the new tag ID.",
  3523. "schema": {
  3524. "$ref": "#/definitions/Tag"
  3525. }
  3526. },
  3527. "default": {
  3528. "description": "Unexpected error.",
  3529. "schema": {
  3530. "$ref": "#/definitions/ErrorResponse"
  3531. }
  3532. }
  3533. }
  3534. }
  3535. },
  3536. "/v1/tags/{tag_id}": {
  3537. "get": {
  3538. "description": "Fetch a tag by id.",
  3539. "consumes": [
  3540. "application/json"
  3541. ],
  3542. "produces": [
  3543. "application/json"
  3544. ],
  3545. "tags": [
  3546. "Tags"
  3547. ],
  3548. "summary": "/tags/{tag_id}",
  3549. "operationId": "getTagById",
  3550. "parameters": [
  3551. {
  3552. "$ref": "#/parameters/accessTokenParam"
  3553. },
  3554. {
  3555. "$ref": "#/parameters/tagPathParam"
  3556. }
  3557. ],
  3558. "responses": {
  3559. "200": {
  3560. "description": "The tag corresponding to tag_id.",
  3561. "schema": {
  3562. "$ref": "#/definitions/Tag"
  3563. }
  3564. },
  3565. "default": {
  3566. "description": "Unexpected error.",
  3567. "schema": {
  3568. "$ref": "#/definitions/ErrorResponse"
  3569. }
  3570. }
  3571. }
  3572. },
  3573. "put": {
  3574. "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.",
  3575. "consumes": [
  3576. "application/json"
  3577. ],
  3578. "produces": [
  3579. "application/json"
  3580. ],
  3581. "tags": [
  3582. "Tags"
  3583. ],
  3584. "summary": "/tags/{tag_id}",
  3585. "operationId": "updateTagById",
  3586. "parameters": [
  3587. {
  3588. "$ref": "#/parameters/accessTokenParam"
  3589. },
  3590. {
  3591. "$ref": "#/parameters/tagPathParam"
  3592. },
  3593. {
  3594. "$ref": "#/parameters/tagUpdateParam"
  3595. }
  3596. ],
  3597. "responses": {
  3598. "200": {
  3599. "description": "The updated tag data.",
  3600. "schema": {
  3601. "$ref": "#/definitions/Tag"
  3602. }
  3603. },
  3604. "default": {
  3605. "description": "Unexpected error.",
  3606. "schema": {
  3607. "$ref": "#/definitions/ErrorResponse"
  3608. }
  3609. }
  3610. }
  3611. },
  3612. "delete": {
  3613. "description": "Permanently deletes a tag.",
  3614. "consumes": [
  3615. "application/json"
  3616. ],
  3617. "produces": [
  3618. "application/json"
  3619. ],
  3620. "tags": [
  3621. "Tags"
  3622. ],
  3623. "summary": "/tags/{tag_id}",
  3624. "operationId": "deleteTagById",
  3625. "parameters": [
  3626. {
  3627. "$ref": "#/parameters/accessTokenParam"
  3628. },
  3629. {
  3630. "$ref": "#/parameters/tagPathParam"
  3631. }
  3632. ],
  3633. "responses": {
  3634. "200": {
  3635. "description": "Successfully deleted the tag. No response body is returned."
  3636. },
  3637. "default": {
  3638. "description": "Unexpected error.",
  3639. "schema": {
  3640. "$ref": "#/definitions/ErrorResponse"
  3641. }
  3642. }
  3643. }
  3644. },
  3645. "patch": {
  3646. "description": "Add or delete specific members from a tag, or modify the name of a tag.",
  3647. "consumes": [
  3648. "application/json"
  3649. ],
  3650. "produces": [
  3651. "application/json"
  3652. ],
  3653. "tags": [
  3654. "Tags"
  3655. ],
  3656. "summary": "/tags/{tag_id}",
  3657. "operationId": "modifyTagById",
  3658. "parameters": [
  3659. {
  3660. "$ref": "#/parameters/accessTokenParam"
  3661. },
  3662. {
  3663. "$ref": "#/parameters/tagPathParam"
  3664. },
  3665. {
  3666. "$ref": "#/parameters/tagModifyParam"
  3667. }
  3668. ],
  3669. "responses": {
  3670. "200": {
  3671. "description": "The updated tag data.",
  3672. "schema": {
  3673. "$ref": "#/definitions/Tag"
  3674. }
  3675. },
  3676. "default": {
  3677. "description": "Unexpected error.",
  3678. "schema": {
  3679. "$ref": "#/definitions/ErrorResponse"
  3680. }
  3681. }
  3682. }
  3683. }
  3684. },
  3685. "/v1/user_roles": {
  3686. "get": {
  3687. "description": "Get all roles in the organization.",
  3688. "tags": [
  3689. "Users"
  3690. ],
  3691. "summary": "/user_roles",
  3692. "operationId": "listUserRoles",
  3693. "parameters": [
  3694. {
  3695. "$ref": "#/parameters/accessTokenParam"
  3696. }
  3697. ],
  3698. "responses": {
  3699. "200": {
  3700. "description": "List of user roles.",
  3701. "schema": {
  3702. "type": "array",
  3703. "items": {
  3704. "$ref": "#/definitions/UserRole"
  3705. }
  3706. }
  3707. },
  3708. "default": {
  3709. "description": "Unexpected error.",
  3710. "schema": {
  3711. "$ref": "#/definitions/ErrorResponse"
  3712. }
  3713. }
  3714. }
  3715. }
  3716. },
  3717. "/v1/users": {
  3718. "get": {
  3719. "description": "List all users in the organization.",
  3720. "tags": [
  3721. "Users"
  3722. ],
  3723. "summary": "/users",
  3724. "operationId": "listUsers",
  3725. "parameters": [
  3726. {
  3727. "$ref": "#/parameters/accessTokenParam"
  3728. }
  3729. ],
  3730. "responses": {
  3731. "200": {
  3732. "description": "List of users.",
  3733. "schema": {
  3734. "type": "array",
  3735. "items": {
  3736. "$ref": "#/definitions/User"
  3737. }
  3738. }
  3739. },
  3740. "default": {
  3741. "description": "Unexpected error.",
  3742. "schema": {
  3743. "$ref": "#/definitions/ErrorResponse"
  3744. }
  3745. }
  3746. }
  3747. },
  3748. "post": {
  3749. "description": "Add a user to the organization.",
  3750. "tags": [
  3751. "Users"
  3752. ],
  3753. "summary": "/users",
  3754. "operationId": "createUser",
  3755. "parameters": [
  3756. {
  3757. "$ref": "#/parameters/accessTokenParam"
  3758. },
  3759. {
  3760. "$ref": "#/parameters/createUserParam"
  3761. }
  3762. ],
  3763. "responses": {
  3764. "200": {
  3765. "description": "User successfully created.",
  3766. "schema": {
  3767. "$ref": "#/definitions/User"
  3768. }
  3769. },
  3770. "default": {
  3771. "description": "Unexpected error.",
  3772. "schema": {
  3773. "$ref": "#/definitions/ErrorResponse"
  3774. }
  3775. }
  3776. }
  3777. }
  3778. },
  3779. "/v1/users/{userId}": {
  3780. "get": {
  3781. "description": "Get a user.",
  3782. "tags": [
  3783. "Users"
  3784. ],
  3785. "summary": "/users/{userId}",
  3786. "operationId": "getUserById",
  3787. "parameters": [
  3788. {
  3789. "$ref": "#/parameters/accessTokenParam"
  3790. },
  3791. {
  3792. "$ref": "#/parameters/createUserParam"
  3793. },
  3794. {
  3795. "type": "integer",
  3796. "format": "int64",
  3797. "description": "ID of the user. Must contain only digits 0-9.",
  3798. "name": "userId",
  3799. "in": "path",
  3800. "required": true
  3801. }
  3802. ],
  3803. "responses": {
  3804. "200": {
  3805. "description": "User record.",
  3806. "schema": {
  3807. "$ref": "#/definitions/User"
  3808. }
  3809. },
  3810. "default": {
  3811. "description": "Unexpected error.",
  3812. "schema": {
  3813. "$ref": "#/definitions/ErrorResponse"
  3814. }
  3815. }
  3816. }
  3817. },
  3818. "delete": {
  3819. "description": "Remove a user from the organization.",
  3820. "tags": [
  3821. "Users"
  3822. ],
  3823. "summary": "/users/{userId}",
  3824. "operationId": "deleteUserById",
  3825. "parameters": [
  3826. {
  3827. "$ref": "#/parameters/accessTokenParam"
  3828. },
  3829. {
  3830. "type": "integer",
  3831. "format": "int64",
  3832. "description": "ID of the user. Must contain only digits 0-9.",
  3833. "name": "userId",
  3834. "in": "path",
  3835. "required": true
  3836. }
  3837. ],
  3838. "responses": {
  3839. "200": {
  3840. "description": "The user was successfully removed."
  3841. },
  3842. "default": {
  3843. "description": "Unexpected error.",
  3844. "schema": {
  3845. "$ref": "#/definitions/ErrorResponse"
  3846. }
  3847. }
  3848. }
  3849. },
  3850. "patch": {
  3851. "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.",
  3852. "tags": [
  3853. "Users"
  3854. ],
  3855. "summary": "/users/{userId}",
  3856. "operationId": "patchUser",
  3857. "parameters": [
  3858. {
  3859. "$ref": "#/parameters/accessTokenParam"
  3860. },
  3861. {
  3862. "$ref": "#/parameters/updateUserParam"
  3863. },
  3864. {
  3865. "type": "integer",
  3866. "format": "int64",
  3867. "description": "ID of the user. Must contain only digits 0-9.",
  3868. "name": "userId",
  3869. "in": "path",
  3870. "required": true
  3871. }
  3872. ],
  3873. "responses": {
  3874. "200": {
  3875. "description": "User successfully updated.",
  3876. "schema": {
  3877. "$ref": "#/definitions/User"
  3878. }
  3879. },
  3880. "default": {
  3881. "description": "Unexpected error.",
  3882. "schema": {
  3883. "$ref": "#/definitions/ErrorResponse"
  3884. }
  3885. }
  3886. }
  3887. }
  3888. }
  3889. },
  3890. "definitions": {
  3891. "Address": {
  3892. "description": "Information about an address/geofence. Geofences are either a circle or a polygon.",
  3893. "type": "object",
  3894. "properties": {
  3895. "contacts": {
  3896. "type": "array",
  3897. "items": {
  3898. "$ref": "#/definitions/Contact"
  3899. }
  3900. },
  3901. "formattedAddress": {
  3902. "description": "The full address associated with this address/geofence, as it might be recognized by maps.google.com",
  3903. "type": "string",
  3904. "example": "350 Rhode Island St, San Francisco, CA"
  3905. },
  3906. "geofence": {
  3907. "$ref": "#/definitions/AddressGeofence"
  3908. },
  3909. "id": {
  3910. "description": "ID of the address",
  3911. "type": "integer",
  3912. "format": "int64",
  3913. "example": 123
  3914. },
  3915. "name": {
  3916. "description": "Name of the address or geofence",
  3917. "type": "string",
  3918. "example": "Samsara HQ"
  3919. },
  3920. "notes": {
  3921. "$ref": "#/definitions/AddressNotes"
  3922. },
  3923. "tags": {
  3924. "type": "array",
  3925. "items": {
  3926. "$ref": "#/definitions/TagMetadata"
  3927. }
  3928. }
  3929. }
  3930. },
  3931. "AddressGeofence": {
  3932. "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.",
  3933. "type": "object",
  3934. "properties": {
  3935. "circle": {
  3936. "description": "Information about a circular geofence. This field is only populated if the geofence is a circle.",
  3937. "type": "object",
  3938. "properties": {
  3939. "latitude": {
  3940. "description": "The latitude of the center of the circular geofence",
  3941. "type": "number",
  3942. "format": "double",
  3943. "example": 37.765363
  3944. },
  3945. "longitude": {
  3946. "description": "The longitude of the center of the circular geofence",
  3947. "type": "number",
  3948. "format": "double",
  3949. "example": -122.403098
  3950. },
  3951. "radiusMeters": {
  3952. "description": "The radius of the circular geofence",
  3953. "type": "number",
  3954. "format": "integer",
  3955. "example": 250
  3956. }
  3957. }
  3958. },
  3959. "polygon": {
  3960. "description": "Information about a polygon geofence. This field is only populated if the geofence is a polygon.",
  3961. "type": "object",
  3962. "properties": {
  3963. "vertices": {
  3964. "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.",
  3965. "type": "array",
  3966. "items": {
  3967. "type": "object",
  3968. "properties": {
  3969. "latitude": {
  3970. "description": "The longitude of a geofence vertex",
  3971. "type": "number",
  3972. "format": "double",
  3973. "example": 37.765363
  3974. },
  3975. "longitude": {
  3976. "description": "The longitude of a geofence vertex",
  3977. "type": "number",
  3978. "format": "double",
  3979. "example": -122.403098
  3980. }
  3981. }
  3982. }
  3983. }
  3984. }
  3985. }
  3986. }
  3987. },
  3988. "AddressNotes": {
  3989. "description": "Notes associated with an address.",
  3990. "type": "string",
  3991. "example": "Delivery site 1"
  3992. },
  3993. "Asset": {
  3994. "description": "Basic information of an asset",
  3995. "type": "object",
  3996. "required": [
  3997. "id"
  3998. ],
  3999. "properties": {
  4000. "assetSerialNumber": {
  4001. "description": "Serial number of the host asset",
  4002. "type": "string",
  4003. "example": "SNTEST123"
  4004. },
  4005. "cable": {
  4006. "description": "The cable connected to the asset",
  4007. "type": "array",
  4008. "items": {
  4009. "type": "object",
  4010. "properties": {
  4011. "assetType": {
  4012. "description": "Asset type",
  4013. "type": "string",
  4014. "example": "Reefer (Thermo King)"
  4015. }
  4016. }
  4017. }
  4018. },
  4019. "engineHours": {
  4020. "description": "Engine hours",
  4021. "type": "integer",
  4022. "example": 104
  4023. },
  4024. "id": {
  4025. "description": "Asset ID",
  4026. "type": "integer",
  4027. "format": "int64",
  4028. "example": 1
  4029. },
  4030. "name": {
  4031. "description": "Asset name",
  4032. "type": "string",
  4033. "example": "Trailer 123"
  4034. }
  4035. }
  4036. },
  4037. "AssetCurrentLocation": {
  4038. "description": "Current location of an asset",
  4039. "type": "object",
  4040. "properties": {
  4041. "latitude": {
  4042. "description": "The latitude of the location in degrees.",
  4043. "type": "number",
  4044. "example": 37
  4045. },
  4046. "location": {
  4047. "description": "The best effort (street,city,state) for the latitude and longitude.",
  4048. "type": "string",
  4049. "example": "525 York, San Francisco, CA"
  4050. },
  4051. "longitude": {
  4052. "description": "The longitude of the location in degrees.",
  4053. "type": "number",
  4054. "example": -122.7
  4055. },
  4056. "speedMilesPerHour": {
  4057. "description": "The speed calculated from GPS that the asset was traveling at in miles per hour.",
  4058. "type": "number",
  4059. "example": 35
  4060. },
  4061. "timeMs": {
  4062. "description": "Time in Unix milliseconds since epoch when the asset was at the location.",
  4063. "type": "number",
  4064. "example": 12314151
  4065. }
  4066. }
  4067. },
  4068. "AssetCurrentLocationsResponse": {
  4069. "description": "Basic information of an asset",
  4070. "type": "object",
  4071. "required": [
  4072. "id"
  4073. ],
  4074. "properties": {
  4075. "cable": {
  4076. "description": "The cable connected to the asset",
  4077. "type": "array",
  4078. "items": {
  4079. "type": "object",
  4080. "properties": {
  4081. "assetType": {
  4082. "description": "Asset type",
  4083. "type": "string",
  4084. "example": "Reefer (Thermo King)"
  4085. }
  4086. }
  4087. }
  4088. },
  4089. "engineHours": {
  4090. "description": "Engine hours",
  4091. "type": "integer",
  4092. "example": 104
  4093. },
  4094. "id": {
  4095. "description": "Asset ID",
  4096. "type": "integer",
  4097. "format": "int64",
  4098. "example": 1
  4099. },
  4100. "location": {
  4101. "description": "Current location of an asset",
  4102. "type": "array",
  4103. "items": {
  4104. "$ref": "#/definitions/AssetCurrentLocation"
  4105. }
  4106. },
  4107. "name": {
  4108. "description": "Asset name",
  4109. "type": "string",
  4110. "example": "Trailer 123"
  4111. }
  4112. }
  4113. },
  4114. "AssetLocationResponse": {
  4115. "description": "A list of historical asset locations.",
  4116. "type": "array",
  4117. "items": {
  4118. "description": "Asset location details.",
  4119. "type": "object",
  4120. "properties": {
  4121. "latitude": {
  4122. "description": "The latitude of the location in degrees.",
  4123. "type": "number",
  4124. "example": 37
  4125. },
  4126. "location": {
  4127. "description": "The best effort (street,city,state) for the latitude and longitude.",
  4128. "type": "string",
  4129. "example": "525 York, San Francisco, CA"
  4130. },
  4131. "longitude": {
  4132. "description": "The longitude of the location in degrees.",
  4133. "type": "number",
  4134. "example": -122.7
  4135. },
  4136. "speedMilesPerHour": {
  4137. "description": "The speed calculated from GPS that the asset was traveling at in miles per hour.",
  4138. "type": "number",
  4139. "example": 35
  4140. },
  4141. "time": {
  4142. "description": "Time in Unix milliseconds since epoch when the asset was at the location.",
  4143. "type": "number",
  4144. "example": 12314151
  4145. }
  4146. }
  4147. }
  4148. },
  4149. "AssetReeferResponse": {
  4150. "description": "Reefer-specific asset details",
  4151. "type": "object",
  4152. "properties": {
  4153. "assetType": {
  4154. "description": "Asset type",
  4155. "type": "string",
  4156. "example": "Reefer (Thermo King)"
  4157. },
  4158. "id": {
  4159. "description": "Asset ID",
  4160. "type": "integer",
  4161. "example": 1
  4162. },
  4163. "name": {
  4164. "description": "Asset name",
  4165. "type": "string",
  4166. "example": "Reefer 123"
  4167. },
  4168. "reeferStats": {
  4169. "type": "object",
  4170. "properties": {
  4171. "alarms": {
  4172. "description": "Reefer alarms",
  4173. "type": "array",
  4174. "items": {
  4175. "type": "object",
  4176. "properties": {
  4177. "alarms": {
  4178. "type": "array",
  4179. "items": {
  4180. "type": "object",
  4181. "properties": {
  4182. "alarmCode": {
  4183. "description": "ID of the alarm",
  4184. "type": "integer",
  4185. "format": "int64",
  4186. "example": 102
  4187. },
  4188. "description": {
  4189. "description": "Description of the alarm",
  4190. "type": "string",
  4191. "example": "Check Return Air Sensor"
  4192. },
  4193. "operatorAction": {
  4194. "description": "Recommended operator action",
  4195. "type": "string",
  4196. "example": "Check and repair at end of trip"
  4197. },
  4198. "severity": {
  4199. "description": "Severity of the alarm: 1: OK to run, 2: Check as specified, 3: Take immediate action",
  4200. "type": "integer",
  4201. "format": "int64",
  4202. "example": 1
  4203. }
  4204. }
  4205. }
  4206. },
  4207. "changedAtMs": {
  4208. "description": "Timestamp when the alarms were reported, in Unix milliseconds since epoch",
  4209. "type": "integer",
  4210. "format": "int64",
  4211. "example": 1453449599999
  4212. }
  4213. }
  4214. }
  4215. },
  4216. "engineHours": {
  4217. "description": "Engine hours of the reefer",
  4218. "type": "array",
  4219. "items": {
  4220. "type": "object",
  4221. "properties": {
  4222. "changedAtMs": {
  4223. "description": "Timestamp in Unix milliseconds since epoch.",
  4224. "type": "integer",
  4225. "format": "int64",
  4226. "example": 1453449599999
  4227. },
  4228. "engineHours": {
  4229. "description": "Engine hours of the reefer.",
  4230. "type": "integer",
  4231. "format": "int64",
  4232. "example": 1200
  4233. }
  4234. }
  4235. }
  4236. },
  4237. "fuelPercentage": {
  4238. "description": "Fuel percentage of the reefer",
  4239. "type": "array",
  4240. "items": {
  4241. "type": "object",
  4242. "properties": {
  4243. "changedAtMs": {
  4244. "description": "Timestamp in Unix milliseconds since epoch.",
  4245. "type": "integer",
  4246. "format": "int64",
  4247. "example": 1453449599999
  4248. },
  4249. "fuelPercentage": {
  4250. "description": "Fuel percentage of the reefer.",
  4251. "type": "integer",
  4252. "format": "int64",
  4253. "example": 99
  4254. }
  4255. }
  4256. }
  4257. },
  4258. "powerStatus": {
  4259. "description": "Power status of the reefer",
  4260. "type": "array",
  4261. "items": {
  4262. "type": "object",
  4263. "properties": {
  4264. "changedAtMs": {
  4265. "description": "Timestamp in Unix milliseconds since epoch.",
  4266. "type": "integer",
  4267. "format": "int64",
  4268. "example": 1453449599999
  4269. },
  4270. "status": {
  4271. "description": "Power status of the reefer.",
  4272. "type": "string",
  4273. "example": "Active (Continuous)"
  4274. }
  4275. }
  4276. }
  4277. },
  4278. "returnAirTemp": {
  4279. "description": "Return air temperature of the reefer",
  4280. "type": "array",
  4281. "items": {
  4282. "type": "object",
  4283. "properties": {
  4284. "changedAtMs": {
  4285. "description": "Timestamp in Unix milliseconds since epoch.",
  4286. "type": "integer",
  4287. "format": "int64",
  4288. "example": 1453449599999
  4289. },
  4290. "tempInMilliC": {
  4291. "description": "Return air temperature in millidegree Celsius.",
  4292. "type": "integer",
  4293. "format": "int64",
  4294. "example": 31110
  4295. }
  4296. }
  4297. }
  4298. },
  4299. "setPoint": {
  4300. "description": "Set point temperature of the reefer",
  4301. "type": "array",
  4302. "items": {
  4303. "type": "object",
  4304. "properties": {
  4305. "changedAtMs": {
  4306. "description": "Timestamp in Unix milliseconds since epoch.",
  4307. "type": "integer",
  4308. "format": "int64",
  4309. "example": 1453449599999
  4310. },
  4311. "tempInMilliC": {
  4312. "description": "Set point temperature in millidegree Celsius.",
  4313. "type": "integer",
  4314. "format": "int64",
  4315. "example": 31110
  4316. }
  4317. }
  4318. }
  4319. }
  4320. }
  4321. }
  4322. }
  4323. },
  4324. "AuxInput": {
  4325. "description": "Digital value of an aux input.",
  4326. "type": "object",
  4327. "required": [
  4328. "timeMs",
  4329. "value"
  4330. ],
  4331. "properties": {
  4332. "timeMs": {
  4333. "description": "Timestamp in Unix epoch milliseconds.",
  4334. "type": "number",
  4335. "format": "int64",
  4336. "example": 1546542978484
  4337. },
  4338. "value": {
  4339. "description": "Boolean representing the digital value of the aux input.",
  4340. "type": "boolean",
  4341. "example": true
  4342. }
  4343. }
  4344. },
  4345. "AuxInputSeries": {
  4346. "description": "A list of aux input values over a timerange.",
  4347. "type": "object",
  4348. "required": [
  4349. "name",
  4350. "values"
  4351. ],
  4352. "properties": {
  4353. "name": {
  4354. "description": "The name of the aux input.",
  4355. "type": "string",
  4356. "enum": [
  4357. "Emergency Lights",
  4358. "Emergency Alarm",
  4359. "Stop Paddle",
  4360. "Power Take-Off",
  4361. "Plow",
  4362. "Sweeper",
  4363. "Salter",
  4364. "Boom"
  4365. ],
  4366. "example": "Boom"
  4367. },
  4368. "values": {
  4369. "type": "array",
  4370. "items": {
  4371. "$ref": "#/definitions/AuxInput"
  4372. }
  4373. }
  4374. }
  4375. },
  4376. "CargoResponse": {
  4377. "description": "Contains the current cargo status of a sensor.",
  4378. "type": "object",
  4379. "properties": {
  4380. "groupId": {
  4381. "type": "integer",
  4382. "format": "int64",
  4383. "example": 101
  4384. },
  4385. "sensors": {
  4386. "type": "array",
  4387. "items": {
  4388. "type": "object",
  4389. "properties": {
  4390. "cargoEmpty": {
  4391. "description": "Flag indicating whether the current cargo is empty or loaded.",
  4392. "type": "boolean",
  4393. "example": true
  4394. },
  4395. "id": {
  4396. "description": "ID of the sensor.",
  4397. "type": "integer",
  4398. "format": "int64",
  4399. "example": 122
  4400. },
  4401. "name": {
  4402. "description": "Name of the sensor.",
  4403. "type": "string",
  4404. "example": "Trailer Cargo Sensor"
  4405. }
  4406. }
  4407. }
  4408. }
  4409. }
  4410. },
  4411. "Contact": {
  4412. "description": "Information about a notification contact for alerts.",
  4413. "type": "object",
  4414. "properties": {
  4415. "email": {
  4416. "description": "Email address of the contact",
  4417. "type": "string",
  4418. "example": "jane.jones@yahoo.com"
  4419. },
  4420. "firstName": {
  4421. "description": "First name of the contact",
  4422. "type": "string",
  4423. "example": "Jane"
  4424. },
  4425. "id": {
  4426. "description": "ID of the contact",
  4427. "type": "integer",
  4428. "format": "int64",
  4429. "example": 123
  4430. },
  4431. "lastName": {
  4432. "description": "Last name of the contact",
  4433. "type": "string",
  4434. "example": "Jones"
  4435. },
  4436. "phone": {
  4437. "description": "Phone number of the contact",
  4438. "type": "string",
  4439. "example": "111-222-3344"
  4440. }
  4441. }
  4442. },
  4443. "ContactData": {
  4444. "description": "Information about a notification contact for alerts.",
  4445. "type": "object",
  4446. "properties": {
  4447. "data": {
  4448. "$ref": "#/definitions/Contact"
  4449. }
  4450. }
  4451. },
  4452. "ContactIds": {
  4453. "description": "A list of IDs for contact book entries.",
  4454. "type": "array",
  4455. "items": {
  4456. "type": "number",
  4457. "format": "int64",
  4458. "example": 123
  4459. }
  4460. },
  4461. "ContactInput": {
  4462. "description": "Information for adding a notification contact for alerts.",
  4463. "type": "object",
  4464. "properties": {
  4465. "email": {
  4466. "description": "Email address of the contact",
  4467. "type": "string",
  4468. "example": "jane.jones@yahoo.com"
  4469. },
  4470. "firstName": {
  4471. "description": "First name of the contact",
  4472. "type": "string",
  4473. "example": "Jane"
  4474. },
  4475. "lastName": {
  4476. "description": "Last name of the contact",
  4477. "type": "string",
  4478. "example": "Jones"
  4479. },
  4480. "phone": {
  4481. "description": "Phone number of the contact",
  4482. "type": "string",
  4483. "example": "111-222-3344"
  4484. }
  4485. }
  4486. },
  4487. "CurrentDriver": {
  4488. "$ref": "#/definitions/Driver"
  4489. },
  4490. "DataInputHistoryResponse": {
  4491. "type": "object",
  4492. "required": [
  4493. "name"
  4494. ],
  4495. "properties": {
  4496. "id": {
  4497. "description": "The ID of this data input",
  4498. "type": "integer",
  4499. "format": "int64",
  4500. "example": 12345
  4501. },
  4502. "name": {
  4503. "description": "Name of this data input",
  4504. "type": "string",
  4505. "example": "Pump Flow"
  4506. },
  4507. "points": {
  4508. "description": "Data points from this data input",
  4509. "type": "array",
  4510. "items": {
  4511. "type": "object",
  4512. "properties": {
  4513. "timeMs": {
  4514. "type": "integer",
  4515. "format": "int64",
  4516. "example": 1453449599999
  4517. },
  4518. "value": {
  4519. "type": "number",
  4520. "format": "double",
  4521. "example": 12.332
  4522. }
  4523. }
  4524. }
  4525. }
  4526. }
  4527. },
  4528. "DispatchJob": {
  4529. "allOf": [
  4530. {
  4531. "type": "object",
  4532. "required": [
  4533. "id",
  4534. "group_id",
  4535. "dispatch_route_id",
  4536. "job_state"
  4537. ],
  4538. "properties": {
  4539. "arrived_at_ms": {
  4540. "description": "The time at which the driver arrived at the job destination.",
  4541. "type": "integer",
  4542. "format": "int64",
  4543. "example": 1462881998034
  4544. },
  4545. "completed_at_ms": {
  4546. "description": "The time at which the job was marked complete (e.g. started driving to the next destination).",
  4547. "type": "integer",
  4548. "format": "int64",
  4549. "example": 1462881998034
  4550. },
  4551. "dispatch_route_id": {
  4552. "description": "ID of the route that this job belongs to.",
  4553. "type": "integer",
  4554. "format": "int64",
  4555. "example": 55
  4556. },
  4557. "documents": {
  4558. "description": "Document submissions associated with this job.",
  4559. "type": "array",
  4560. "items": {
  4561. "$ref": "#/definitions/DispatchJobDocumentInfo"
  4562. }
  4563. },
  4564. "driver_id": {
  4565. "description": "ID of the driver assigned to the dispatch job.",
  4566. "type": "integer",
  4567. "format": "int64",
  4568. "example": 444
  4569. },
  4570. "en_route_at_ms": {
  4571. "description": "The time at which the assigned driver started fulfilling the job (e.g. started driving to the destination).",
  4572. "type": "integer",
  4573. "format": "int64",
  4574. "example": 1462881998034
  4575. },
  4576. "estimated_arrival_ms": {
  4577. "description": "The time at which the assigned driver is estimated to arrive at the job destination. Only valid for en-route jobs.",
  4578. "type": "integer",
  4579. "format": "int64",
  4580. "example": 1462881998034
  4581. },
  4582. "fleet_viewer_url": {
  4583. "description": "Fleet viewer url of the dispatch job.",
  4584. "type": "string",
  4585. "example": "https://cloud.samsara.com/fleet/viewer/job/fleet_viewer_token"
  4586. },
  4587. "group_id": {
  4588. "type": "integer",
  4589. "format": "int64",
  4590. "example": 101
  4591. },
  4592. "id": {
  4593. "description": "ID of the Samsara dispatch job.",
  4594. "type": "integer",
  4595. "format": "int64",
  4596. "example": 773
  4597. },
  4598. "job_state": {
  4599. "$ref": "#/definitions/jobStatus"
  4600. },
  4601. "skipped_at_ms": {
  4602. "description": "The time at which the job was marked skipped.",
  4603. "type": "integer",
  4604. "format": "int64",
  4605. "example": 1462881998034
  4606. },
  4607. "vehicle_id": {
  4608. "description": "ID of the vehicle used for the dispatch job.",
  4609. "type": "integer",
  4610. "format": "int64",
  4611. "example": 112
  4612. }
  4613. }
  4614. },
  4615. {
  4616. "$ref": "#/definitions/DispatchJobCreate"
  4617. }
  4618. ]
  4619. },
  4620. "DispatchJobCreate": {
  4621. "type": "object",
  4622. "required": [
  4623. "scheduled_arrival_time_ms"
  4624. ],
  4625. "properties": {
  4626. "destination_address": {
  4627. "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.",
  4628. "type": "string",
  4629. "example": "123 Main St, Philadelphia, PA 19106"
  4630. },
  4631. "destination_address_id": {
  4632. "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.",
  4633. "type": "integer",
  4634. "format": "int64",
  4635. "example": 67890
  4636. },
  4637. "destination_lat": {
  4638. "description": "Latitude of the destination in decimal degrees. Optional if a valid destination address ID is provided.",
  4639. "type": "number",
  4640. "format": "double",
  4641. "example": 123.456
  4642. },
  4643. "destination_lng": {
  4644. "description": "Longitude of the destination in decimal degrees. Optional if a valid destination address ID is provided.",
  4645. "type": "number",
  4646. "format": "double",
  4647. "example": 37.459
  4648. },
  4649. "destination_name": {
  4650. "description": "The name of the job destination. If provided, it will take precedence over the name of the address book entry.",
  4651. "type": "string",
  4652. "example": "ACME Inc. Philadelphia HQ"
  4653. },
  4654. "notes": {
  4655. "description": "Notes regarding the details of this job.",
  4656. "type": "string",
  4657. "example": "Ensure crates are stacked no more than 3 high."
  4658. },
  4659. "scheduled_arrival_time_ms": {
  4660. "description": "The time at which the assigned driver is scheduled to arrive at the job destination.",
  4661. "type": "integer",
  4662. "format": "int64",
  4663. "example": 1462881998034
  4664. },
  4665. "scheduled_departure_time_ms": {
  4666. "description": "The time at which the assigned driver is scheduled to depart from the job destination.",
  4667. "type": "integer",
  4668. "format": "int64",
  4669. "example": 1462881998034
  4670. }
  4671. }
  4672. },
  4673. "DispatchJobDocumentInfo": {
  4674. "type": "object",
  4675. "required": [
  4676. "driverId",
  4677. "id"
  4678. ],
  4679. "properties": {
  4680. "driverId": {
  4681. "description": "ID of driver that submitted the document.",
  4682. "type": "integer",
  4683. "example": 1234
  4684. },
  4685. "id": {
  4686. "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",
  4687. "type": "string",
  4688. "example": "2018_42424242"
  4689. }
  4690. }
  4691. },
  4692. "DispatchJobUpdate": {
  4693. "allOf": [
  4694. {
  4695. "type": "object",
  4696. "required": [
  4697. "id",
  4698. "dispatch_jobs"
  4699. ],
  4700. "properties": {
  4701. "id": {
  4702. "description": "ID of the Samsara dispatch job to update",
  4703. "type": "integer",
  4704. "format": "int64",
  4705. "example": 42
  4706. }
  4707. }
  4708. },
  4709. {
  4710. "$ref": "#/definitions/DispatchJobCreate"
  4711. }
  4712. ]
  4713. },
  4714. "DispatchRoute": {
  4715. "allOf": [
  4716. {
  4717. "type": "object",
  4718. "required": [
  4719. "id",
  4720. "dispatch_jobs"
  4721. ],
  4722. "properties": {
  4723. "dispatch_jobs": {
  4724. "description": "The dispatch jobs associated with this route.",
  4725. "type": "array",
  4726. "items": {
  4727. "$ref": "#/definitions/DispatchJob"
  4728. }
  4729. },
  4730. "id": {
  4731. "description": "ID of the Samsara dispatch route.",
  4732. "type": "integer",
  4733. "format": "int64",
  4734. "example": 556
  4735. }
  4736. }
  4737. },
  4738. {
  4739. "$ref": "#/definitions/DispatchRouteBase"
  4740. }
  4741. ]
  4742. },
  4743. "DispatchRouteBase": {
  4744. "type": "object",
  4745. "required": [
  4746. "name",
  4747. "scheduled_start_ms",
  4748. "scheduled_end_ms"
  4749. ],
  4750. "properties": {
  4751. "actual_end_ms": {
  4752. "description": "The time in Unix epoch milliseconds that the route actually ended.",
  4753. "type": "integer",
  4754. "format": "int64",
  4755. "example": 1462882101000
  4756. },
  4757. "actual_start_ms": {
  4758. "description": "The time in Unix epoch milliseconds that the route actually started.",
  4759. "type": "integer",
  4760. "format": "int64",
  4761. "example": 1462882098000
  4762. },
  4763. "driver_id": {
  4764. "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.",
  4765. "type": "integer",
  4766. "format": "int64",
  4767. "example": 555
  4768. },
  4769. "group_id": {
  4770. "description": "ID of the group if the organization has multiple groups (optional).",
  4771. "type": "integer",
  4772. "format": "int64",
  4773. "example": 101
  4774. },
  4775. "name": {
  4776. "description": "Descriptive name of this route.",
  4777. "type": "string",
  4778. "example": "Bid #123"
  4779. },
  4780. "odometer_end_meters": {
  4781. "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.",
  4782. "type": "integer",
  4783. "format": "int64",
  4784. "example": 2000000
  4785. },
  4786. "odometer_start_meters": {
  4787. "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.",
  4788. "type": "integer",
  4789. "format": "int64",
  4790. "example": 1000000
  4791. },
  4792. "scheduled_end_ms": {
  4793. "description": "The time in Unix epoch milliseconds that the last job in the route is scheduled to end.",
  4794. "type": "integer",
  4795. "format": "int64",
  4796. "example": 1462881998034
  4797. },
  4798. "scheduled_meters": {
  4799. "description": "The distance expected to be traveled for this route in meters.",
  4800. "type": "integer",
  4801. "format": "int64",
  4802. "example": 10000
  4803. },
  4804. "scheduled_start_ms": {
  4805. "description": "The time in Unix epoch milliseconds that the route is scheduled to start.",
  4806. "type": "integer",
  4807. "format": "int64",
  4808. "example": 1462881998034
  4809. },
  4810. "start_location_address": {
  4811. "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.",
  4812. "type": "string",
  4813. "example": "123 Main St, Philadelphia, PA 19106"
  4814. },
  4815. "start_location_address_id": {
  4816. "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.",
  4817. "type": "integer",
  4818. "format": "int64",
  4819. "example": 67890
  4820. },
  4821. "start_location_lat": {
  4822. "description": "Latitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
  4823. "type": "number",
  4824. "format": "double",
  4825. "example": 123.456
  4826. },
  4827. "start_location_lng": {
  4828. "description": "Longitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
  4829. "type": "number",
  4830. "format": "double",
  4831. "example": 37.459
  4832. },
  4833. "start_location_name": {
  4834. "description": "The name of the route's starting location. If provided, it will take precedence over the name of the address book entry.",
  4835. "type": "string",
  4836. "example": "ACME Inc. Philadelphia HQ"
  4837. },
  4838. "trailer_id": {
  4839. "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.",
  4840. "type": "integer",
  4841. "format": "int64",
  4842. "example": 666
  4843. },
  4844. "vehicle_id": {
  4845. "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.",
  4846. "type": "integer",
  4847. "format": "int64",
  4848. "example": 444
  4849. }
  4850. }
  4851. },
  4852. "DispatchRouteCreate": {
  4853. "allOf": [
  4854. {
  4855. "type": "object",
  4856. "required": [
  4857. "dispatch_jobs"
  4858. ],
  4859. "properties": {
  4860. "dispatch_jobs": {
  4861. "description": "The dispatch jobs to create for this route.",
  4862. "type": "array",
  4863. "items": {
  4864. "$ref": "#/definitions/DispatchJobCreate"
  4865. }
  4866. }
  4867. }
  4868. },
  4869. {
  4870. "$ref": "#/definitions/DispatchRouteCreateBase"
  4871. }
  4872. ]
  4873. },
  4874. "DispatchRouteCreateBase": {
  4875. "type": "object",
  4876. "required": [
  4877. "name",
  4878. "scheduled_start_ms"
  4879. ],
  4880. "properties": {
  4881. "driver_id": {
  4882. "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.",
  4883. "type": "integer",
  4884. "format": "int64",
  4885. "example": 555
  4886. },
  4887. "group_id": {
  4888. "description": "ID of the group if the organization has multiple groups (optional).",
  4889. "type": "integer",
  4890. "format": "int64",
  4891. "example": 101
  4892. },
  4893. "name": {
  4894. "description": "Descriptive name of this route.",
  4895. "type": "string",
  4896. "example": "Bid #123"
  4897. },
  4898. "scheduled_end_ms": {
  4899. "description": "The time in Unix epoch milliseconds that the last job in the route is scheduled to end.",
  4900. "type": "integer",
  4901. "format": "int64",
  4902. "example": 1462881998034
  4903. },
  4904. "scheduled_meters": {
  4905. "description": "The distance expected to be traveled for this route in meters.",
  4906. "type": "integer",
  4907. "format": "int64",
  4908. "example": 10000
  4909. },
  4910. "scheduled_start_ms": {
  4911. "description": "The time in Unix epoch milliseconds that the route is scheduled to start.",
  4912. "type": "integer",
  4913. "format": "int64",
  4914. "example": 1462881998034
  4915. },
  4916. "start_location_address": {
  4917. "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.",
  4918. "type": "string",
  4919. "example": "123 Main St, Philadelphia, PA 19106"
  4920. },
  4921. "start_location_address_id": {
  4922. "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.",
  4923. "type": "integer",
  4924. "format": "int64",
  4925. "example": 67890
  4926. },
  4927. "start_location_lat": {
  4928. "description": "Latitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
  4929. "type": "number",
  4930. "format": "double",
  4931. "example": 123.456
  4932. },
  4933. "start_location_lng": {
  4934. "description": "Longitude of the start location in decimal degrees. Optional if a valid start location address ID is provided.",
  4935. "type": "number",
  4936. "format": "double",
  4937. "example": 37.459
  4938. },
  4939. "start_location_name": {
  4940. "description": "The name of the route's starting location. If provided, it will take precedence over the name of the address book entry.",
  4941. "type": "string",
  4942. "example": "ACME Inc. Philadelphia HQ"
  4943. },
  4944. "trailer_id": {
  4945. "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.",
  4946. "type": "integer",
  4947. "format": "int64",
  4948. "example": 666
  4949. },
  4950. "vehicle_id": {
  4951. "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.",
  4952. "type": "integer",
  4953. "format": "int64",
  4954. "example": 444
  4955. }
  4956. }
  4957. },
  4958. "DispatchRouteHistoricalEntry": {
  4959. "type": "object",
  4960. "properties": {
  4961. "changed_at_ms": {
  4962. "description": "Timestamp that the route was updated, represented as Unix milliseconds since epoch.",
  4963. "type": "integer",
  4964. "format": "int64",
  4965. "example": 1499411220000
  4966. },
  4967. "route": {
  4968. "$ref": "#/definitions/DispatchRoute"
  4969. }
  4970. }
  4971. },
  4972. "DispatchRouteHistory": {
  4973. "type": "object",
  4974. "properties": {
  4975. "history": {
  4976. "description": "History of the route's state changes.",
  4977. "type": "array",
  4978. "items": {
  4979. "$ref": "#/definitions/DispatchRouteHistoricalEntry"
  4980. }
  4981. }
  4982. }
  4983. },
  4984. "DispatchRouteUpdate": {
  4985. "allOf": [
  4986. {
  4987. "type": "object",
  4988. "required": [
  4989. "dispatch_jobs"
  4990. ],
  4991. "properties": {
  4992. "dispatch_jobs": {
  4993. "description": "The dispatch jobs for the route.",
  4994. "type": "array",
  4995. "items": {
  4996. "$ref": "#/definitions/DispatchJobUpdate"
  4997. }
  4998. }
  4999. }
  5000. },
  5001. {
  5002. "$ref": "#/definitions/DispatchRouteUpdateBase"
  5003. }
  5004. ]
  5005. },
  5006. "DispatchRouteUpdateBase": {
  5007. "allOf": [
  5008. {
  5009. "type": "object",
  5010. "required": [
  5011. "id"
  5012. ],
  5013. "properties": {
  5014. "id": {
  5015. "description": "ID of route. This must match the route ID passed in URL.",
  5016. "type": "integer",
  5017. "format": "int64",
  5018. "example": "42"
  5019. }
  5020. }
  5021. },
  5022. {
  5023. "$ref": "#/definitions/DispatchRouteCreateBase"
  5024. }
  5025. ]
  5026. },
  5027. "DispatchRoutes": {
  5028. "type": "array",
  5029. "items": {
  5030. "$ref": "#/definitions/DispatchRoute"
  5031. }
  5032. },
  5033. "Document": {
  5034. "allOf": [
  5035. {
  5036. "type": "object",
  5037. "required": [
  5038. "id",
  5039. "orgId",
  5040. "driverId",
  5041. "driverCreatedAtMs",
  5042. "documentType",
  5043. "fields"
  5044. ],
  5045. "properties": {
  5046. "documentType": {
  5047. "description": "Descriptive name of this type of document.",
  5048. "type": "string",
  5049. "example": "Fuel Receipt"
  5050. },
  5051. "driverCreatedAtMs": {
  5052. "description": "The time in Unix epoch milliseconds that the document is created.",
  5053. "type": "integer",
  5054. "format": "int64",
  5055. "example": 1462881998034
  5056. },
  5057. "driverId": {
  5058. "description": "ID of the driver for whom the document is submitted",
  5059. "type": "integer",
  5060. "format": "int64",
  5061. "example": 555
  5062. },
  5063. "fields": {
  5064. "description": "The fields associated with this document.",
  5065. "type": "array",
  5066. "items": {
  5067. "$ref": "#/definitions/DocumentField"
  5068. },
  5069. "example": [
  5070. {
  5071. "label": "Photos",
  5072. "photoValue": [],
  5073. "valueType": "ValueType_Photo"
  5074. },
  5075. {
  5076. "label": "Gallons",
  5077. "numberValue": 12.34,
  5078. "valueType": "ValueType_Number"
  5079. },
  5080. {
  5081. "label": "City",
  5082. "stringValue": "San Francisco, CA",
  5083. "valueType": "ValueType_String"
  5084. },
  5085. {
  5086. "label": "Fuel Type",
  5087. "multipleChoiceValue": [
  5088. {
  5089. "selected": true,
  5090. "value": "Diesel"
  5091. },
  5092. {
  5093. "selected": false,
  5094. "value": "Gas"
  5095. }
  5096. ],
  5097. "valueType": "ValueType_MultipleChoice"
  5098. }
  5099. ]
  5100. },
  5101. "id": {
  5102. "description": "ID of the document",
  5103. "type": "string",
  5104. "example": "2018_42424242"
  5105. },
  5106. "orgId": {
  5107. "description": "Organization ID that the document \u0026 driver who submitted the doc belongs to",
  5108. "type": "integer",
  5109. "format": "int64",
  5110. "example": 555
  5111. },
  5112. "vehicleId": {
  5113. "description": "VehicleID of the driver at document creation.",
  5114. "type": "integer",
  5115. "format": "int64",
  5116. "example": 222
  5117. }
  5118. }
  5119. },
  5120. {
  5121. "$ref": "#/definitions/DocumentBase"
  5122. }
  5123. ]
  5124. },
  5125. "DocumentBase": {
  5126. "type": "object",
  5127. "required": [
  5128. "dispatchJobId",
  5129. "notes"
  5130. ],
  5131. "properties": {
  5132. "dispatchJobId": {
  5133. "description": "ID of the Samsara dispatch job for which the document is submitted",
  5134. "type": "integer",
  5135. "format": "int64",
  5136. "example": 773
  5137. },
  5138. "notes": {
  5139. "description": "Notes submitted with this document.",
  5140. "type": "string",
  5141. "example": "Fueled up before delivery."
  5142. }
  5143. }
  5144. },
  5145. "DocumentCreate": {
  5146. "allOf": [
  5147. {
  5148. "description": "Arguments to create a document.",
  5149. "type": "object",
  5150. "required": [
  5151. "documentTypeUuid",
  5152. "fields"
  5153. ],
  5154. "properties": {
  5155. "documentTypeUuid": {
  5156. "description": "Universally unique identifier for the document type this document is being created for.",
  5157. "type": "string",
  5158. "example": "4aff772c-a7bb-45e6-8e41-6a53e34feb83"
  5159. },
  5160. "fields": {
  5161. "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.",
  5162. "type": "array",
  5163. "items": {
  5164. "$ref": "#/definitions/DocumentField"
  5165. },
  5166. "example": [
  5167. {
  5168. "label": "Gallons",
  5169. "numberValue": 12.34,
  5170. "valueType": "ValueType_Number"
  5171. },
  5172. {
  5173. "label": "City",
  5174. "stringValue": "San Francisco, CA",
  5175. "valueType": "ValueType_String"
  5176. },
  5177. {
  5178. "label": "Fuel Type",
  5179. "multipleChoiceValue": [
  5180. {
  5181. "selected": true,
  5182. "value": "Diesel"
  5183. },
  5184. {
  5185. "selected": false,
  5186. "value": "Gas"
  5187. }
  5188. ],
  5189. "valueType": "ValueType_MultipleChoice"
  5190. }
  5191. ]
  5192. }
  5193. }
  5194. },
  5195. {
  5196. "$ref": "#/definitions/DocumentCreateBase"
  5197. }
  5198. ]
  5199. },
  5200. "DocumentCreateBase": {
  5201. "type": "object",
  5202. "properties": {
  5203. "dispatchJobId": {
  5204. "description": "ID of the Samsara dispatch job for which the document is submitted",
  5205. "type": "integer",
  5206. "format": "int64",
  5207. "example": 773
  5208. },
  5209. "notes": {
  5210. "description": "Notes submitted with this document.",
  5211. "type": "string",
  5212. "example": "Fueled up before delivery."
  5213. }
  5214. }
  5215. },
  5216. "DocumentField": {
  5217. "allOf": [
  5218. {
  5219. "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.",
  5220. "type": "object",
  5221. "required": [
  5222. "label"
  5223. ],
  5224. "properties": {
  5225. "label": {
  5226. "description": "Descriptive name of this field.",
  5227. "type": "string",
  5228. "example": "Fuel Cost ($)"
  5229. },
  5230. "value": {
  5231. "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.",
  5232. "example": 23.45
  5233. }
  5234. }
  5235. },
  5236. {
  5237. "$ref": "#/definitions/DocumentFieldCreate"
  5238. }
  5239. ]
  5240. },
  5241. "DocumentFieldCreate": {
  5242. "type": "object",
  5243. "required": [
  5244. "valueType"
  5245. ],
  5246. "properties": {
  5247. "multipleChoiceValue": {
  5248. "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",
  5249. "type": "array",
  5250. "items": {
  5251. "type": "object",
  5252. "properties": {
  5253. "selected": {
  5254. "type": "boolean"
  5255. },
  5256. "value": {
  5257. "type": "string"
  5258. }
  5259. }
  5260. }
  5261. },
  5262. "numberValue": {
  5263. "description": "Value of this field if this document field has valueType: ValueType_Number.",
  5264. "type": "number",
  5265. "format": "double",
  5266. "example": 12.34
  5267. },
  5268. "photoValue": {
  5269. "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.",
  5270. "type": "array",
  5271. "items": {
  5272. "type": "object",
  5273. "properties": {
  5274. "url": {
  5275. "description": "Photo URL for a JPG image",
  5276. "type": "string"
  5277. }
  5278. }
  5279. },
  5280. "example": [
  5281. {
  5282. "url": "https://www.samsara.com/photo1"
  5283. },
  5284. {
  5285. "url": "https://www.samsara.com/photo2"
  5286. }
  5287. ]
  5288. },
  5289. "stringValue": {
  5290. "description": "Value of this field if this document field has valueType: ValueType_String.",
  5291. "type": "string",
  5292. "example": "This is a string."
  5293. },
  5294. "valueType": {
  5295. "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.",
  5296. "type": "string",
  5297. "example": "ValueType_Number"
  5298. }
  5299. }
  5300. },
  5301. "DocumentFieldType": {
  5302. "type": "object",
  5303. "required": [
  5304. "label",
  5305. "valueType"
  5306. ],
  5307. "properties": {
  5308. "label": {
  5309. "description": "Descriptive name of this field type.",
  5310. "type": "string",
  5311. "example": "Fuel Cost ($)"
  5312. },
  5313. "numberValueTypeMetadata": {
  5314. "description": "Additional metadata information for a number field type. Only defined when a field type has valueType: ValueType_Number.",
  5315. "type": "object",
  5316. "properties": {
  5317. "numDecimalPlaces": {
  5318. "description": "Number of decimal places that values for this field type can have.",
  5319. "type": "number",
  5320. "format": "int64",
  5321. "example": 2
  5322. }
  5323. }
  5324. },
  5325. "valueType": {
  5326. "description": "The kind of value that can be submitted for this fieldType. It should be either ValueType_Number, ValueType_String, or ValueType_Photo.",
  5327. "type": "string",
  5328. "example": "ValueType_Number"
  5329. }
  5330. }
  5331. },
  5332. "DocumentFieldTypes": {
  5333. "type": "array",
  5334. "items": {
  5335. "$ref": "#/definitions/DocumentFieldType"
  5336. }
  5337. },
  5338. "DocumentType": {
  5339. "type": "object",
  5340. "required": [
  5341. "name",
  5342. "orgId",
  5343. "uuid"
  5344. ],
  5345. "properties": {
  5346. "fieldTypes": {
  5347. "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.",
  5348. "type": "array",
  5349. "items": {
  5350. "$ref": "#/definitions/DocumentFieldTypes"
  5351. }
  5352. },
  5353. "name": {
  5354. "description": "Name of the document type.",
  5355. "type": "string",
  5356. "example": "Fuel Receipt"
  5357. },
  5358. "orgId": {
  5359. "description": "ID for the organization this document belongs to.",
  5360. "type": "integer",
  5361. "format": "int64",
  5362. "example": 773
  5363. },
  5364. "uuid": {
  5365. "description": "Universally unique identifier for the document type. Can be passed in as a documentTypeUuid when creating a document for this document type.",
  5366. "type": "string",
  5367. "example": "4aff772c-a7bb-45e6-8e41-6a53e34feb83"
  5368. }
  5369. }
  5370. },
  5371. "DocumentTypes": {
  5372. "type": "array",
  5373. "items": {
  5374. "$ref": "#/definitions/DocumentType"
  5375. }
  5376. },
  5377. "Documents": {
  5378. "type": "array",
  5379. "items": {
  5380. "$ref": "#/definitions/Document"
  5381. }
  5382. },
  5383. "DoorResponse": {
  5384. "description": "Contains the current door status of a sensor.",
  5385. "type": "object",
  5386. "properties": {
  5387. "groupId": {
  5388. "type": "integer",
  5389. "format": "int64",
  5390. "example": 101
  5391. },
  5392. "sensors": {
  5393. "type": "array",
  5394. "items": {
  5395. "type": "object",
  5396. "properties": {
  5397. "doorClosed": {
  5398. "description": "Flag indicating whether the current door is closed or open.",
  5399. "type": "boolean",
  5400. "example": true
  5401. },
  5402. "id": {
  5403. "description": "ID of the sensor.",
  5404. "type": "integer",
  5405. "format": "int64",
  5406. "example": 122
  5407. },
  5408. "name": {
  5409. "description": "Name of the sensor.",
  5410. "type": "string",
  5411. "example": "Trailer Door Sensor"
  5412. }
  5413. }
  5414. }
  5415. }
  5416. }
  5417. },
  5418. "Driver": {
  5419. "allOf": [
  5420. {
  5421. "type": "object",
  5422. "required": [
  5423. "id"
  5424. ],
  5425. "properties": {
  5426. "id": {
  5427. "description": "ID of the driver.",
  5428. "type": "integer",
  5429. "format": "int64",
  5430. "example": 556
  5431. },
  5432. "isDeactivated": {
  5433. "description": "True if the driver account has been deactivated.",
  5434. "type": "boolean"
  5435. },
  5436. "tags": {
  5437. "type": "array",
  5438. "items": {
  5439. "$ref": "#/definitions/TagMetadata"
  5440. }
  5441. }
  5442. }
  5443. },
  5444. {
  5445. "type": "object",
  5446. "properties": {
  5447. "currentVehicleId": {
  5448. "description": "ID of the vehicle that this driver is currently assigned to. Omitted if there is no current vehicle assignment for this driver.",
  5449. "type": "integer",
  5450. "format": "int64",
  5451. "example": 879
  5452. }
  5453. }
  5454. },
  5455. {
  5456. "$ref": "#/definitions/DriverBase"
  5457. }
  5458. ]
  5459. },
  5460. "DriverBase": {
  5461. "type": "object",
  5462. "required": [
  5463. "name"
  5464. ],
  5465. "properties": {
  5466. "eldAdverseWeatherExemptionEnabled": {
  5467. "description": "Flag indicating this driver may use Adverse Weather exemptions in ELD logs.",
  5468. "type": "boolean"
  5469. },
  5470. "eldBigDayExemptionEnabled": {
  5471. "description": "Flag indicating this driver may use Big Day excemptions in ELD logs.",
  5472. "type": "boolean"
  5473. },
  5474. "eldDayStartHour": {
  5475. "description": "0 indicating midnight-to-midnight ELD driving hours, 12 to indicate noon-to-noon driving hours.",
  5476. "type": "integer"
  5477. },
  5478. "eldExempt": {
  5479. "description": "Flag indicating this driver is exempt from the Electronic Logging Mandate.",
  5480. "type": "boolean"
  5481. },
  5482. "eldExemptReason": {
  5483. "description": "Reason that this driver is exempt from the Electronic Logging Mandate (see eldExempt).",
  5484. "type": "string"
  5485. },
  5486. "eldPcEnabled": {
  5487. "description": "Flag indicating this driver may select the Personal Conveyance duty status in ELD logs.",
  5488. "type": "boolean",
  5489. "default": false
  5490. },
  5491. "eldYmEnabled": {
  5492. "description": "Flag indicating this driver may select the Yard Move duty status in ELD logs.",
  5493. "type": "boolean",
  5494. "default": false
  5495. },
  5496. "externalIds": {
  5497. "description": "Dictionary of external IDs (string key-value pairs)",
  5498. "type": "object",
  5499. "additionalProperties": {
  5500. "type": "string"
  5501. },
  5502. "example": {
  5503. "maintenanceId": "250020",
  5504. "payrollId": "123"
  5505. }
  5506. },
  5507. "groupId": {
  5508. "description": "ID of the group if the organization has multiple groups (uncommon).",
  5509. "type": "integer",
  5510. "format": "int64",
  5511. "example": 101
  5512. },
  5513. "licenseNumber": {
  5514. "description": "Driver's state issued license number.",
  5515. "type": "string",
  5516. "example": "E1234567"
  5517. },
  5518. "licenseState": {
  5519. "description": "Abbreviation of state that issued driver's license.",
  5520. "type": "string",
  5521. "example": "CA"
  5522. },
  5523. "name": {
  5524. "description": "Driver's name.",
  5525. "type": "string",
  5526. "example": "Susan Jones"
  5527. },
  5528. "notes": {
  5529. "description": "Notes about the driver.",
  5530. "type": "string",
  5531. "example": "Also goes by the nickname 'Furious Fred'."
  5532. },
  5533. "phone": {
  5534. "description": "Driver's phone number. Please include only digits, ex. 4157771234",
  5535. "type": "string",
  5536. "example": "5558234327"
  5537. },
  5538. "username": {
  5539. "description": "Driver's login username into the driver app.",
  5540. "type": "string",
  5541. "example": "Susan Jones"
  5542. },
  5543. "vehicleId": {
  5544. "description": "ID of the vehicle assigned to the driver for static vehicle assignments. (uncommon).",
  5545. "type": "integer",
  5546. "format": "int64",
  5547. "example": 444
  5548. }
  5549. }
  5550. },
  5551. "DriverDailyLogResponse": {
  5552. "type": "object",
  5553. "properties": {
  5554. "days": {
  5555. "type": "array",
  5556. "items": {
  5557. "type": "object",
  5558. "properties": {
  5559. "activeHours": {
  5560. "description": "Hours spent on duty or driving, rounded to two decimal places.",
  5561. "type": "number",
  5562. "format": "double",
  5563. "example": 5.4
  5564. },
  5565. "activeMs": {
  5566. "description": "Milliseconds spent on duty or driving.",
  5567. "type": "integer",
  5568. "format": "int64",
  5569. "example": 691200
  5570. },
  5571. "certified": {
  5572. "description": "Whether this HOS day chart was certified by the driver.",
  5573. "type": "boolean"
  5574. },
  5575. "certifiedAtMs": {
  5576. "description": "Unix epoch time (in ms) of time when this chart was certified. If this chart is uncertified, 0.",
  5577. "type": "number",
  5578. "format": "int64"
  5579. },
  5580. "distanceMiles": {
  5581. "description": "Distance driven in miles, rounded to two decimal places.",
  5582. "type": "number",
  5583. "format": "double",
  5584. "example": 123.24
  5585. },
  5586. "endMs": {
  5587. "description": "End of the HOS day, specified in milliseconds UNIX time.",
  5588. "type": "integer",
  5589. "example": 1473836400000
  5590. },
  5591. "startMs": {
  5592. "description": "End of the HOS day, specified in milliseconds UNIX time.",
  5593. "type": "integer",
  5594. "example": 1473750000000
  5595. },
  5596. "trailerIds": {
  5597. "description": "List of trailer ID's associated with the driver for the day.",
  5598. "type": "object",
  5599. "format": "int64",
  5600. "example": [
  5601. 10293,
  5602. 192933
  5603. ]
  5604. },
  5605. "vehicleIds": {
  5606. "description": "List of vehicle ID's associated with the driver for the day.",
  5607. "type": "object",
  5608. "format": "int64",
  5609. "example": [
  5610. 192319,
  5611. 12958
  5612. ]
  5613. }
  5614. }
  5615. }
  5616. }
  5617. }
  5618. },
  5619. "DriverForCreate": {
  5620. "allOf": [
  5621. {
  5622. "type": "object",
  5623. "required": [
  5624. "password"
  5625. ],
  5626. "properties": {
  5627. "password": {
  5628. "description": "Driver's password for the driver app.",
  5629. "type": "string",
  5630. "example": "mypassword"
  5631. },
  5632. "tagIds": {
  5633. "$ref": "#/definitions/TagIds"
  5634. }
  5635. }
  5636. },
  5637. {
  5638. "$ref": "#/definitions/DriverBase"
  5639. }
  5640. ]
  5641. },
  5642. "DriverForUpdate": {
  5643. "allOf": [
  5644. {
  5645. "type": "object",
  5646. "properties": {
  5647. "tagIds": {
  5648. "$ref": "#/definitions/TagIds"
  5649. }
  5650. }
  5651. },
  5652. {
  5653. "$ref": "#/definitions/DriverBase"
  5654. }
  5655. ]
  5656. },
  5657. "DriverSafetyScoreResponse": {
  5658. "description": "Safety score details for a driver",
  5659. "type": "object",
  5660. "properties": {
  5661. "crashCount": {
  5662. "description": "Crash event count",
  5663. "type": "integer",
  5664. "example": 0
  5665. },
  5666. "driverId": {
  5667. "description": "Driver ID",
  5668. "type": "integer",
  5669. "example": 1234
  5670. },
  5671. "harshAccelCount": {
  5672. "description": "Harsh acceleration event count",
  5673. "type": "integer",
  5674. "example": 1
  5675. },
  5676. "harshBrakingCount": {
  5677. "description": "Harsh braking event count",
  5678. "type": "integer",
  5679. "example": 2
  5680. },
  5681. "harshEvents": {
  5682. "type": "array",
  5683. "items": {
  5684. "$ref": "#/definitions/SafetyReportHarshEvent"
  5685. }
  5686. },
  5687. "harshTurningCount": {
  5688. "description": "Harsh turning event count",
  5689. "type": "integer",
  5690. "example": 0
  5691. },
  5692. "safetyScore": {
  5693. "description": "Safety Score",
  5694. "type": "integer",
  5695. "example": 97
  5696. },
  5697. "safetyScoreRank": {
  5698. "description": "Safety Score Rank",
  5699. "type": "string",
  5700. "example": "26"
  5701. },
  5702. "timeOverSpeedLimitMs": {
  5703. "description": "Amount of time driven over the speed limit in milliseconds",
  5704. "type": "integer",
  5705. "example": 3769
  5706. },
  5707. "totalDistanceDrivenMeters": {
  5708. "description": "Total distance driven in meters",
  5709. "type": "integer",
  5710. "example": 291836
  5711. },
  5712. "totalHarshEventCount": {
  5713. "description": "Total harsh event count",
  5714. "type": "integer",
  5715. "example": 3
  5716. },
  5717. "totalTimeDrivenMs": {
  5718. "description": "Amount of time driven in milliseconds",
  5719. "type": "integer",
  5720. "example": 19708293
  5721. }
  5722. }
  5723. },
  5724. "DriversResponse": {
  5725. "type": "object",
  5726. "properties": {
  5727. "drivers": {
  5728. "type": "array",
  5729. "items": {
  5730. "$ref": "#/definitions/Driver"
  5731. }
  5732. }
  5733. }
  5734. },
  5735. "DriversSummaryResponse": {
  5736. "type": "object",
  5737. "properties": {
  5738. "Summaries": {
  5739. "type": "array",
  5740. "items": {
  5741. "type": "object",
  5742. "properties": {
  5743. "activeMs": {
  5744. "description": "Duration in milliseconds that driver was on duty or driving during the requested time range",
  5745. "type": "number",
  5746. "format": "int64",
  5747. "example": 43200000
  5748. },
  5749. "distanceMiles": {
  5750. "description": "Distance driven in miles, rounded to two decimal places.",
  5751. "type": "number",
  5752. "format": "double",
  5753. "example": 123.24
  5754. },
  5755. "driveMs": {
  5756. "description": "Duration in milliseconds that driver was driving during the requested time range",
  5757. "type": "number",
  5758. "format": "int64",
  5759. "example": 21600000
  5760. },
  5761. "driverId": {
  5762. "description": "ID of the driver.",
  5763. "type": "integer",
  5764. "format": "int64",
  5765. "example": 444
  5766. },
  5767. "driverName": {
  5768. "description": "Name of the driver.",
  5769. "type": "string",
  5770. "example": "Fred Jacobs"
  5771. },
  5772. "driverUsername": {
  5773. "description": "Username of the driver.",
  5774. "type": "string",
  5775. "example": "fjacobs"
  5776. },
  5777. "groupId": {
  5778. "description": "Group of the driver.",
  5779. "type": "integer",
  5780. "format": "int64",
  5781. "example": 111
  5782. },
  5783. "onDutyMs": {
  5784. "description": "Duration in milliseconds that driver was on duty during the requested time range",
  5785. "type": "number",
  5786. "format": "int64",
  5787. "example": 21600000
  5788. }
  5789. }
  5790. }
  5791. }
  5792. }
  5793. },
  5794. "DvirBase": {
  5795. "type": "object",
  5796. "properties": {
  5797. "authorSignature": {
  5798. "description": "The authors signature for the DVIR.",
  5799. "type": "object",
  5800. "properties": {
  5801. "driverId": {
  5802. "description": "ID of the driver who signed the DVIR. Will not be returned if mechanicUserId is returned.",
  5803. "type": "integer",
  5804. "format": "int64",
  5805. "example": 2581
  5806. },
  5807. "email": {
  5808. "description": "Email of the driver|mechanic who signed the DVIR.",
  5809. "type": "string",
  5810. "example": "j.smith@yahoo.com"
  5811. },
  5812. "mechanicUserId": {
  5813. "description": "ID of the mechanic who signed the DVIR. Will not be returned if driverId is returned.",
  5814. "type": "integer",
  5815. "format": "int64",
  5816. "example": 14849
  5817. },
  5818. "name": {
  5819. "description": "The name of the driver or mechanic who signed the DVIR.",
  5820. "type": "string",
  5821. "example": "John Smith"
  5822. },
  5823. "signedAt": {
  5824. "description": "The time in millis when the DVIR was signed",
  5825. "type": "integer",
  5826. "format": "int64",
  5827. "example": 12535500000
  5828. },
  5829. "type": {
  5830. "description": "Type corresponds to whether the signature corresponds to driver|mechanic.",
  5831. "type": "string",
  5832. "example": "driver"
  5833. },
  5834. "username": {
  5835. "description": "Username of the driver|mechanic who signed the DVIR.",
  5836. "type": "string",
  5837. "example": "jsmith"
  5838. }
  5839. }
  5840. },
  5841. "defectsCorrected": {
  5842. "description": "Signifies if the defects on the vehicle corrected after the DVIR is done.",
  5843. "type": "boolean",
  5844. "example": true
  5845. },
  5846. "defectsNeedNotBeCorrected": {
  5847. "description": "Signifies if the defects on this vehicle can be ignored.",
  5848. "type": "boolean",
  5849. "example": false
  5850. },
  5851. "id": {
  5852. "description": "The id of this DVIR record.",
  5853. "type": "integer",
  5854. "format": "int64",
  5855. "example": 19
  5856. },
  5857. "inspectionType": {
  5858. "description": "Inspection type of the DVIR.",
  5859. "type": "string",
  5860. "example": "pre trip"
  5861. },
  5862. "mechanicNotes": {
  5863. "description": "The mechanics notes on the DVIR.",
  5864. "type": "string",
  5865. "example": "The vehicle is now safe."
  5866. },
  5867. "mechanicOrAgentSignature": {
  5868. "description": "The mechanic's or agent's signature for the DVIR.",
  5869. "type": "object",
  5870. "properties": {
  5871. "driverId": {
  5872. "description": "ID of the driver who signed the DVIR. Will not be returned if mechanicUserId is returned.",
  5873. "type": "integer",
  5874. "format": "int64",
  5875. "example": 2581
  5876. },
  5877. "email": {
  5878. "description": "Email of the agent|mechanic who signed the DVIR.",
  5879. "type": "string",
  5880. "example": "j.smith@yahoo.com"
  5881. },
  5882. "mechanicUserId": {
  5883. "description": "ID of the mechanic who signed the DVIR. Will not be returned if driverId is returned.",
  5884. "type": "integer",
  5885. "format": "int64",
  5886. "example": 14849
  5887. },
  5888. "name": {
  5889. "description": "The name of the agent or mechanic who signed the DVIR.",
  5890. "type": "string",
  5891. "example": "John Smith"
  5892. },
  5893. "signedAt": {
  5894. "description": "The time in millis when the DVIR was signed",
  5895. "type": "integer",
  5896. "format": "int64",
  5897. "example": 12535500000
  5898. },
  5899. "type": {
  5900. "description": "Type corresponds to whether the signature corresponds to driver|mechanic.",
  5901. "type": "string",
  5902. "example": "driver"
  5903. },
  5904. "username": {
  5905. "description": "Username of the agent|mechanic who signed the DVIR.",
  5906. "type": "string",
  5907. "example": "jsmith"
  5908. }
  5909. }
  5910. },
  5911. "nextDriverSignature": {
  5912. "description": "The next driver signature for the DVIR.",
  5913. "type": "object",
  5914. "properties": {
  5915. "driverId": {
  5916. "description": "ID of the driver who signed the DVIR",
  5917. "type": "integer",
  5918. "format": "int64",
  5919. "example": 2581
  5920. },
  5921. "email": {
  5922. "description": "Email of the driver who signed the next DVIR on this vehicle.",
  5923. "type": "string",
  5924. "example": "j.smith@yahoo.com"
  5925. },
  5926. "name": {
  5927. "description": "The name of the driver who signed the next DVIR on this vehicle.",
  5928. "type": "string",
  5929. "example": "John Smith"
  5930. },
  5931. "signedAt": {
  5932. "description": "The time in millis when the next driver signed the DVIR on this vehicle.",
  5933. "type": "integer",
  5934. "format": "int64",
  5935. "example": 12535500000
  5936. },
  5937. "type": {
  5938. "description": "Type corresponds to driver.",
  5939. "type": "string",
  5940. "example": "driver"
  5941. },
  5942. "username": {
  5943. "description": "Username of the driver who signed the next DVIR on this vehicle.",
  5944. "type": "string",
  5945. "example": "jsmith"
  5946. }
  5947. }
  5948. },
  5949. "odometerMiles": {
  5950. "description": "The odometer reading in miles for the vehicle when the DVIR was done.",
  5951. "type": "integer",
  5952. "format": "int64",
  5953. "example": 49912
  5954. },
  5955. "timeMs": {
  5956. "description": "Timestamp of this DVIR in UNIX milliseconds.",
  5957. "type": "integer",
  5958. "format": "int64",
  5959. "example": 1453449599999
  5960. },
  5961. "trailerDefects": {
  5962. "description": "Defects registered for the trailer which was part of the DVIR.",
  5963. "type": "array",
  5964. "items": {
  5965. "type": "object",
  5966. "properties": {
  5967. "comment": {
  5968. "description": "The comment describing the type of DVIR defect",
  5969. "type": "string",
  5970. "example": "Air Compressor not working"
  5971. },
  5972. "defectType": {
  5973. "description": "The type of DVIR defect",
  5974. "type": "string",
  5975. "example": "Air Compressor"
  5976. }
  5977. }
  5978. }
  5979. },
  5980. "trailerId": {
  5981. "description": "The id of the trailer which was part of the DVIR.",
  5982. "type": "integer",
  5983. "example": 19
  5984. },
  5985. "trailerName": {
  5986. "description": "The name of the trailer which was part of the DVIR.",
  5987. "type": "string",
  5988. "example": "Storer's Trailer 19"
  5989. },
  5990. "vehicle": {
  5991. "description": "The vehicle on which DVIR was done.",
  5992. "type": "object",
  5993. "properties": {
  5994. "id": {
  5995. "description": "The vehicle id on which DVIR was done.",
  5996. "type": "integer",
  5997. "format": "int64",
  5998. "example": 19
  5999. },
  6000. "name": {
  6001. "description": "The vehicle on which DVIR was done.",
  6002. "type": "string",
  6003. "example": "Storer's vehicle 19"
  6004. }
  6005. }
  6006. },
  6007. "vehicleCondition": {
  6008. "description": "The condition of vechile on which DVIR was done.",
  6009. "type": "string",
  6010. "example": "SATISFACTORY"
  6011. },
  6012. "vehicleDefects": {
  6013. "description": "Defects registered for the vehicle which was part of the DVIR.",
  6014. "type": "array",
  6015. "items": {
  6016. "type": "object",
  6017. "properties": {
  6018. "comment": {
  6019. "description": "The comment describing the type of DVIR defect",
  6020. "type": "string",
  6021. "example": "Air Compressor not working"
  6022. },
  6023. "defectType": {
  6024. "description": "The type of DVIR defect",
  6025. "type": "string",
  6026. "example": "Air Compressor"
  6027. }
  6028. }
  6029. }
  6030. }
  6031. }
  6032. },
  6033. "DvirListResponse": {
  6034. "type": "object",
  6035. "properties": {
  6036. "dvirs": {
  6037. "type": "array",
  6038. "items": {
  6039. "$ref": "#/definitions/DvirBase"
  6040. }
  6041. }
  6042. }
  6043. },
  6044. "EngineState": {
  6045. "description": "The state of the vehicle over time. State can be Running, Off, or Idle.",
  6046. "type": "object",
  6047. "required": [
  6048. "timeMs",
  6049. "value"
  6050. ],
  6051. "properties": {
  6052. "timeMs": {
  6053. "description": "Timestamp in Unix epoch milliseconds.",
  6054. "type": "number",
  6055. "format": "int64",
  6056. "example": 1546542978484
  6057. },
  6058. "value": {
  6059. "type": "string",
  6060. "enum": [
  6061. "Running",
  6062. "Off",
  6063. "Idle"
  6064. ]
  6065. }
  6066. }
  6067. },
  6068. "ErrorResponse": {
  6069. "description": "Error message describing why the request failed.",
  6070. "type": "string"
  6071. },
  6072. "FleetVehicleLocation": {
  6073. "description": "Contains the location and speed of a vehicle at a particular time",
  6074. "type": "object",
  6075. "properties": {
  6076. "latitude": {
  6077. "description": "The latitude of the location in degrees.",
  6078. "type": "number",
  6079. "format": "double",
  6080. "example": 37.2
  6081. },
  6082. "location": {
  6083. "description": "The best effort (street,city,state) for the latitude and longitude.",
  6084. "type": "string",
  6085. "example": "525 York, San Francisco, CA"
  6086. },
  6087. "longitude": {
  6088. "description": "The longitude of the location in degrees.",
  6089. "type": "number",
  6090. "format": "double",
  6091. "example": -122.5
  6092. },
  6093. "speedMilesPerHour": {
  6094. "description": "The speed calculated from GPS that the asset was traveling at in miles per hour.",
  6095. "type": "number",
  6096. "format": "double",
  6097. "example": 35.2
  6098. },
  6099. "timeMs": {
  6100. "description": "Time in Unix milliseconds since epoch when the asset was at the location.",
  6101. "type": "number",
  6102. "format": "int64",
  6103. "example": 1535586471332
  6104. }
  6105. }
  6106. },
  6107. "FleetVehicleLocations": {
  6108. "type": "array",
  6109. "items": {
  6110. "$ref": "#/definitions/FleetVehicleLocation"
  6111. }
  6112. },
  6113. "FleetVehicleResponse": {
  6114. "description": "A vehicle object as returned for fleet/vehicle",
  6115. "type": "object",
  6116. "required": [
  6117. "id",
  6118. "name"
  6119. ],
  6120. "properties": {
  6121. "externalIds": {
  6122. "type": "object",
  6123. "additionalProperties": {
  6124. "type": "string"
  6125. },
  6126. "example": {
  6127. "maintenanceId": "ABFS18600"
  6128. }
  6129. },
  6130. "harshAccelSetting": {
  6131. "description": "Harsh event detection setting.",
  6132. "type": "string",
  6133. "example": "Heavy"
  6134. },
  6135. "id": {
  6136. "description": "ID of the vehicle.",
  6137. "type": "integer",
  6138. "format": "int64",
  6139. "example": 112
  6140. },
  6141. "name": {
  6142. "description": "Name of the vehicle.",
  6143. "type": "string",
  6144. "example": "Truck A7"
  6145. },
  6146. "vehicleInfo": {
  6147. "type": "object",
  6148. "properties": {
  6149. "make": {
  6150. "description": "Make of the vehicle.",
  6151. "type": "string",
  6152. "example": "Honda"
  6153. },
  6154. "model": {
  6155. "description": "Model of the Vehicle.",
  6156. "type": "string",
  6157. "example": "Odyssey"
  6158. },
  6159. "vin": {
  6160. "description": "Vehicle Identification Number.",
  6161. "type": "string",
  6162. "example": "1FUJA6BD31LJ09646"
  6163. },
  6164. "year": {
  6165. "description": "Year of the vehicle.",
  6166. "type": "integer",
  6167. "format": "int64",
  6168. "example": 1997
  6169. }
  6170. }
  6171. }
  6172. }
  6173. },
  6174. "FleetVehiclesLocations": {
  6175. "type": "array",
  6176. "items": {
  6177. "type": "object",
  6178. "properties": {
  6179. "id": {
  6180. "description": "ID of the vehicle.",
  6181. "type": "integer",
  6182. "format": "int64",
  6183. "example": 112
  6184. },
  6185. "locations": {
  6186. "$ref": "#/definitions/FleetVehicleLocations"
  6187. },
  6188. "name": {
  6189. "description": "Name of the vehicle.",
  6190. "type": "string",
  6191. "example": "Truck A7"
  6192. }
  6193. }
  6194. }
  6195. },
  6196. "HosAuthenticationLogsResponse": {
  6197. "type": "object",
  6198. "properties": {
  6199. "authenticationLogs": {
  6200. "type": "array",
  6201. "items": {
  6202. "type": "object",
  6203. "properties": {
  6204. "actionType": {
  6205. "description": "The log type - one of 'signin' or 'signout'",
  6206. "type": "string",
  6207. "example": "signin"
  6208. },
  6209. "address": {
  6210. "description": "Address at which the log was recorded, if applicable.",
  6211. "type": "string",
  6212. "example": "123 Main St., Ahwatukee, Arizona 85044"
  6213. },
  6214. "addressName": {
  6215. "description": "Address name from the group address book at which the log was recorded, if applicable.",
  6216. "type": "string",
  6217. "example": "Garage Number 3"
  6218. },
  6219. "city": {
  6220. "description": "City in which the log was recorded, if applicable.",
  6221. "type": "string",
  6222. "example": "Ahwatukee"
  6223. },
  6224. "happenedAtMs": {
  6225. "description": "The time at which the event was recorded in UNIX milliseconds.",
  6226. "type": "integer",
  6227. "format": "int64",
  6228. "example": 1462881998034
  6229. },
  6230. "state": {
  6231. "description": "State in which the log was recorded, if applicable.",
  6232. "type": "string",
  6233. "example": "Arizona"
  6234. }
  6235. }
  6236. }
  6237. }
  6238. }
  6239. },
  6240. "HosLogsResponse": {
  6241. "type": "object",
  6242. "properties": {
  6243. "logs": {
  6244. "type": "array",
  6245. "items": {
  6246. "type": "object",
  6247. "properties": {
  6248. "codriverIds": {
  6249. "type": "array",
  6250. "items": {
  6251. "description": "Ids of codrivers during any of the logged trips",
  6252. "type": "number",
  6253. "example": 445
  6254. }
  6255. },
  6256. "driverId": {
  6257. "description": "ID of the driver.",
  6258. "type": "integer",
  6259. "format": "int64",
  6260. "example": 444
  6261. },
  6262. "groupId": {
  6263. "description": "ID of the group.",
  6264. "type": "integer",
  6265. "format": "int64",
  6266. "example": 101
  6267. },
  6268. "locCity": {
  6269. "description": "City in which the log was recorded.",
  6270. "type": "string",
  6271. "example": "Ahwatukee"
  6272. },
  6273. "locLat": {
  6274. "description": "Latitude at which the log was recorded.",
  6275. "type": "number",
  6276. "format": "float",
  6277. "example": 23.413702345
  6278. },
  6279. "locLng": {
  6280. "description": "Longitude at which the log was recorded.",
  6281. "type": "number",
  6282. "format": "float",
  6283. "example": -98.502888123
  6284. },
  6285. "locName": {
  6286. "description": "Name of location at which the log was recorded.",
  6287. "type": "string",
  6288. "example": "McLean Site A"
  6289. },
  6290. "locState": {
  6291. "description": "State in which the log was recorded.",
  6292. "type": "string",
  6293. "example": "Arizona"
  6294. },
  6295. "logStartMs": {
  6296. "description": "The time at which the log/HOS status started in UNIX milliseconds.",
  6297. "type": "integer",
  6298. "format": "int64",
  6299. "example": 1462881998034
  6300. },
  6301. "remark": {
  6302. "description": "Remark associated with the log entry.",
  6303. "type": "string",
  6304. "example": "Lunch Break"
  6305. },
  6306. "statusType": {
  6307. "description": "The Hours of Service status type. One of `OFF_DUTY`, `SLEEPER_BED`, `DRIVING`, `ON_DUTY`, `YARD_MOVE`, `PERSONAL_CONVEYANCE`.",
  6308. "type": "string",
  6309. "example": "OFF_DUTY"
  6310. },
  6311. "vehicleId": {
  6312. "description": "ID of the vehicle.",
  6313. "type": "integer",
  6314. "format": "int64",
  6315. "example": 112
  6316. }
  6317. }
  6318. }
  6319. }
  6320. }
  6321. },
  6322. "HosLogsSummaryResponse": {
  6323. "type": "object",
  6324. "properties": {
  6325. "drivers": {
  6326. "type": "array",
  6327. "items": {
  6328. "type": "object",
  6329. "properties": {
  6330. "cycleRemaining": {
  6331. "description": "The amount of remaining cycle time (in ms).",
  6332. "type": "integer",
  6333. "format": "int64",
  6334. "example": 252000000
  6335. },
  6336. "cycleTomorrow": {
  6337. "description": "The amount of cycle time (in ms) available tomorrow.",
  6338. "type": "integer",
  6339. "format": "int64",
  6340. "example": 252000000
  6341. },
  6342. "driverId": {
  6343. "description": "ID of the driver.",
  6344. "type": "integer",
  6345. "format": "int64",
  6346. "example": 444
  6347. },
  6348. "driverName": {
  6349. "description": "Name of the driver.",
  6350. "type": "string",
  6351. "example": "Fred Jacobs"
  6352. },
  6353. "drivingInViolationCycle": {
  6354. "description": "The amount of driving time in violation in this cycle (in ms).",
  6355. "type": "integer",
  6356. "format": "int64",
  6357. "example": 50400000
  6358. },
  6359. "drivingInViolationToday": {
  6360. "description": "The amount of driving time in violation today (in ms).",
  6361. "type": "integer",
  6362. "format": "int64",
  6363. "example": 39600000
  6364. },
  6365. "dutyStatus": {
  6366. "description": "The Hours of Service status type. One of `OFF_DUTY`, `SLEEPER_BED`, `DRIVING`, `ON_DUTY`, `YARD_MOVE`, `PERSONAL_CONVEYANCE`.",
  6367. "type": "string",
  6368. "example": "OFF_DUTY"
  6369. },
  6370. "shiftDriveRemaining": {
  6371. "description": "The amount of remaining shift drive time (in ms).",
  6372. "type": "integer",
  6373. "format": "int64",
  6374. "example": 39600000
  6375. },
  6376. "shiftRemaining": {
  6377. "description": "The amount of remaining shift time (in ms).",
  6378. "type": "integer",
  6379. "format": "int64",
  6380. "example": 50400000
  6381. },
  6382. "timeInCurrentStatus": {
  6383. "description": "The amount of time (in ms) that the driver has been in the current `dutyStatus`.",
  6384. "type": "integer",
  6385. "format": "int64",
  6386. "example": 5000
  6387. },
  6388. "timeUntilBreak": {
  6389. "description": "The amount of time (in ms) remaining until the driver cannot drive without a rest break.",
  6390. "type": "integer",
  6391. "format": "int64",
  6392. "example": 28800000
  6393. },
  6394. "vehicleName": {
  6395. "description": "Name of the vehicle.",
  6396. "type": "string",
  6397. "example": "Vehicle 1"
  6398. }
  6399. }
  6400. }
  6401. }
  6402. }
  6403. },
  6404. "HumidityResponse": {
  6405. "description": "Contains the current humidity of a sensor.",
  6406. "type": "object",
  6407. "properties": {
  6408. "groupId": {
  6409. "type": "integer",
  6410. "format": "int64",
  6411. "example": 101
  6412. },
  6413. "sensors": {
  6414. "type": "array",
  6415. "items": {
  6416. "type": "object",
  6417. "properties": {
  6418. "humidity": {
  6419. "description": "Currently reported relative humidity in percent, from 0-100.",
  6420. "type": "integer",
  6421. "example": 53
  6422. },
  6423. "id": {
  6424. "description": "ID of the sensor.",
  6425. "type": "integer",
  6426. "format": "int64",
  6427. "example": 122
  6428. },
  6429. "name": {
  6430. "description": "Name of the sensor.",
  6431. "type": "string",
  6432. "example": "Freezer Humidity Sensor"
  6433. }
  6434. }
  6435. }
  6436. }
  6437. }
  6438. },
  6439. "Machine": {
  6440. "description": "Contains information about a machine.",
  6441. "type": "object",
  6442. "required": [
  6443. "id"
  6444. ],
  6445. "properties": {
  6446. "id": {
  6447. "description": "ID of the machine.",
  6448. "type": "integer",
  6449. "format": "int64",
  6450. "example": 123
  6451. },
  6452. "name": {
  6453. "description": "Name of the machine.",
  6454. "type": "string",
  6455. "example": "Freezer ABC"
  6456. },
  6457. "notes": {
  6458. "description": "Notes about the machine",
  6459. "type": "string",
  6460. "example": "This is in the left hallway behind the conveyor belt"
  6461. }
  6462. }
  6463. },
  6464. "MachineHistoryResponse": {
  6465. "description": "Contains the results for a machine history request",
  6466. "type": "object",
  6467. "properties": {
  6468. "machines": {
  6469. "type": "array",
  6470. "items": {
  6471. "type": "object",
  6472. "properties": {
  6473. "id": {
  6474. "description": "Machine ID",
  6475. "type": "integer",
  6476. "example": 1
  6477. },
  6478. "name": {
  6479. "description": "Machine name",
  6480. "type": "string",
  6481. "example": "1/3 HP Motor"
  6482. },
  6483. "vibrations": {
  6484. "description": "List of vibration datapoints, with timestamp and vibration measurement for x/y/z axis in mm/s",
  6485. "type": "array",
  6486. "items": {
  6487. "type": "object",
  6488. "properties": {
  6489. "X": {
  6490. "type": "number",
  6491. "format": "double",
  6492. "example": 0.01
  6493. },
  6494. "Y": {
  6495. "type": "number",
  6496. "format": "double",
  6497. "example": 1.23
  6498. },
  6499. "Z": {
  6500. "type": "number",
  6501. "format": "double",
  6502. "example": 2.55
  6503. },
  6504. "time": {
  6505. "type": "integer",
  6506. "format": "int64",
  6507. "example": 1453449599999
  6508. }
  6509. }
  6510. }
  6511. }
  6512. }
  6513. }
  6514. }
  6515. }
  6516. },
  6517. "Message": {
  6518. "type": "object",
  6519. "required": [
  6520. "driverId",
  6521. "text"
  6522. ],
  6523. "properties": {
  6524. "driverId": {
  6525. "description": "ID of the driver for whom the message is sent to or sent by.",
  6526. "type": "integer",
  6527. "format": "int64",
  6528. "example": 555
  6529. },
  6530. "text": {
  6531. "description": "The text sent in the message.",
  6532. "type": "string",
  6533. "example": "This is a message."
  6534. }
  6535. }
  6536. },
  6537. "MessageResponse": {
  6538. "type": "object",
  6539. "required": [
  6540. "driverId",
  6541. "text",
  6542. "sentAtMs",
  6543. "sender",
  6544. "isRead"
  6545. ],
  6546. "properties": {
  6547. "driverId": {
  6548. "description": "ID of the driver for whom the message is sent to or sent by.",
  6549. "type": "integer",
  6550. "format": "int64",
  6551. "example": 555
  6552. },
  6553. "isRead": {
  6554. "description": "True if the message was read by the recipient.",
  6555. "type": "boolean",
  6556. "example": true
  6557. },
  6558. "sender": {
  6559. "$ref": "#/definitions/MessageSender"
  6560. },
  6561. "sentAtMs": {
  6562. "description": "The time in Unix epoch milliseconds that the message is sent to the recipient.",
  6563. "type": "integer",
  6564. "format": "int64",
  6565. "example": 1462881998034
  6566. },
  6567. "text": {
  6568. "description": "The text sent in the message.",
  6569. "type": "string",
  6570. "example": "This is a message."
  6571. }
  6572. }
  6573. },
  6574. "MessageSender": {
  6575. "type": "object",
  6576. "required": [
  6577. "type",
  6578. "name"
  6579. ],
  6580. "properties": {
  6581. "name": {
  6582. "description": "Name of user that is sending the message.",
  6583. "type": "string",
  6584. "example": "John Doe"
  6585. },
  6586. "type": {
  6587. "description": "Type of user that is sending the message. It will be either dispatch or driver.",
  6588. "type": "string",
  6589. "example": "dispatch"
  6590. }
  6591. }
  6592. },
  6593. "Messages": {
  6594. "type": "array",
  6595. "items": {
  6596. "$ref": "#/definitions/Message"
  6597. }
  6598. },
  6599. "MessagesResponse": {
  6600. "type": "array",
  6601. "items": {
  6602. "$ref": "#/definitions/MessageResponse"
  6603. }
  6604. },
  6605. "Pagination": {
  6606. "type": "object",
  6607. "required": [
  6608. "hasNextPage",
  6609. "hasPrevPage",
  6610. "startCursor",
  6611. "endCursor"
  6612. ],
  6613. "properties": {
  6614. "endCursor": {
  6615. "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.",
  6616. "type": "string",
  6617. "example": "MTU5MTEzNjA2OTU0MzQ3"
  6618. },
  6619. "hasNextPage": {
  6620. "description": "True if there are more pages of results after this response.",
  6621. "type": "boolean"
  6622. },
  6623. "hasPrevPage": {
  6624. "description": "True if there are more pages of results before this response.",
  6625. "type": "boolean"
  6626. },
  6627. "startCursor": {
  6628. "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.",
  6629. "type": "string",
  6630. "example": "MTU5MTEzNjA2OTU0MzQ3"
  6631. }
  6632. }
  6633. },
  6634. "ProgramsForTheCameraResponse": {
  6635. "description": "Contains the list of Programs configured on the given Camera.",
  6636. "type": "array",
  6637. "items": {
  6638. "type": "object",
  6639. "properties": {
  6640. "programId": {
  6641. "type": "integer",
  6642. "format": "int64",
  6643. "example": 1
  6644. },
  6645. "programName": {
  6646. "type": "string",
  6647. "example": "Barcode verification program"
  6648. }
  6649. }
  6650. }
  6651. },
  6652. "SafetyReportHarshEvent": {
  6653. "description": "List of harsh events",
  6654. "type": "object",
  6655. "properties": {
  6656. "harshEventType": {
  6657. "description": "Type of the harsh event",
  6658. "type": "string",
  6659. "example": "Harsh Braking"
  6660. },
  6661. "timestampMs": {
  6662. "description": "Timestamp that the harsh event occurred in Unix milliseconds since epoch",
  6663. "type": "integer",
  6664. "example": 1535590776000
  6665. },
  6666. "vehicleId": {
  6667. "description": "Vehicle associated with the harsh event",
  6668. "type": "integer",
  6669. "example": 212014918086169
  6670. }
  6671. }
  6672. },
  6673. "Sensor": {
  6674. "description": "Contains information about a sensor.",
  6675. "type": "object",
  6676. "required": [
  6677. "id"
  6678. ],
  6679. "properties": {
  6680. "id": {
  6681. "description": "ID of the sensor.",
  6682. "type": "integer",
  6683. "format": "int64",
  6684. "example": 123
  6685. },
  6686. "macAddress": {
  6687. "description": "MAC address of the sensor.",
  6688. "type": "string",
  6689. "example": "11:11:11:11:11:11"
  6690. },
  6691. "name": {
  6692. "description": "Name of the sensor.",
  6693. "type": "string",
  6694. "example": "Freezer ABC"
  6695. }
  6696. }
  6697. },
  6698. "SensorHistoryResponse": {
  6699. "description": "Contains the results for a sensor history request. Each result contains a timestamp and datapoint for each requested (sensor, field) pair.",
  6700. "type": "object",
  6701. "properties": {
  6702. "results": {
  6703. "type": "array",
  6704. "items": {
  6705. "type": "object",
  6706. "properties": {
  6707. "series": {
  6708. "description": "List of datapoints, one for each requested (sensor, field) pair.",
  6709. "type": "array",
  6710. "items": {
  6711. "type": "integer",
  6712. "format": "int64",
  6713. "example": 1
  6714. }
  6715. },
  6716. "timeMs": {
  6717. "description": "Timestamp in UNIX milliseconds.",
  6718. "type": "integer",
  6719. "example": 1453449599999
  6720. }
  6721. }
  6722. }
  6723. }
  6724. }
  6725. },
  6726. "Tag": {
  6727. "type": "object",
  6728. "required": [
  6729. "id",
  6730. "name"
  6731. ],
  6732. "properties": {
  6733. "addresses": {
  6734. "description": "The addresses that belong to this tag.",
  6735. "type": "array",
  6736. "items": {
  6737. "$ref": "#/definitions/TaggedAddress"
  6738. }
  6739. },
  6740. "assets": {
  6741. "description": "The assets that belong to this tag.",
  6742. "type": "array",
  6743. "items": {
  6744. "$ref": "#/definitions/TaggedAsset"
  6745. }
  6746. },
  6747. "drivers": {
  6748. "description": "The drivers that belong to this tag.",
  6749. "type": "array",
  6750. "items": {
  6751. "$ref": "#/definitions/TaggedDriver"
  6752. }
  6753. },
  6754. "groupId": {
  6755. "description": "The GroupID that this tag belongs to.",
  6756. "type": "integer",
  6757. "format": "int64",
  6758. "example": 2348
  6759. },
  6760. "id": {
  6761. "description": "The ID of this tag.",
  6762. "type": "integer",
  6763. "format": "int64",
  6764. "example": 12345
  6765. },
  6766. "machines": {
  6767. "description": "The machines that belong to this tag.",
  6768. "type": "array",
  6769. "items": {
  6770. "$ref": "#/definitions/TaggedMachine"
  6771. }
  6772. },
  6773. "name": {
  6774. "description": "Name of this tag.",
  6775. "type": "string",
  6776. "example": "Broken Vehicles"
  6777. },
  6778. "parentTagId": {
  6779. "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.",
  6780. "type": "integer",
  6781. "format": "int64",
  6782. "example": 8389
  6783. },
  6784. "sensors": {
  6785. "description": "The sensors that belong to this tag.",
  6786. "type": "array",
  6787. "items": {
  6788. "$ref": "#/definitions/TaggedSensor"
  6789. }
  6790. },
  6791. "vehicles": {
  6792. "description": "The vehicles that belong to this tag.",
  6793. "type": "array",
  6794. "items": {
  6795. "$ref": "#/definitions/TaggedVehicle"
  6796. }
  6797. }
  6798. }
  6799. },
  6800. "TagCreate": {
  6801. "type": "object",
  6802. "required": [
  6803. "name"
  6804. ],
  6805. "properties": {
  6806. "assets": {
  6807. "description": "The assets that belong to this tag.",
  6808. "type": "array",
  6809. "items": {
  6810. "$ref": "#/definitions/TaggedAssetBase"
  6811. }
  6812. },
  6813. "drivers": {
  6814. "description": "The drivers that belong to this tag.",
  6815. "type": "array",
  6816. "items": {
  6817. "$ref": "#/definitions/TaggedDriverBase"
  6818. }
  6819. },
  6820. "machines": {
  6821. "description": "The machines that belong to this tag.",
  6822. "type": "array",
  6823. "items": {
  6824. "$ref": "#/definitions/TaggedMachineBase"
  6825. }
  6826. },
  6827. "name": {
  6828. "description": "Name of this tag.",
  6829. "type": "string",
  6830. "example": "Broken Vehicles"
  6831. },
  6832. "parentTagId": {
  6833. "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.",
  6834. "type": "integer",
  6835. "format": "int64",
  6836. "example": 8389
  6837. },
  6838. "sensors": {
  6839. "description": "The sensors that belong to this tag.",
  6840. "type": "array",
  6841. "items": {
  6842. "$ref": "#/definitions/TaggedSensorBase"
  6843. }
  6844. },
  6845. "vehicles": {
  6846. "description": "The vehicles that belong to this tag.",
  6847. "type": "array",
  6848. "items": {
  6849. "$ref": "#/definitions/TaggedVehicleBase"
  6850. }
  6851. }
  6852. }
  6853. },
  6854. "TagIds": {
  6855. "description": "A list of tag IDs.",
  6856. "type": "array",
  6857. "items": {
  6858. "type": "number",
  6859. "format": "int64",
  6860. "example": 123
  6861. }
  6862. },
  6863. "TagMetadata": {
  6864. "type": "object",
  6865. "required": [
  6866. "id",
  6867. "name"
  6868. ],
  6869. "properties": {
  6870. "id": {
  6871. "description": "The ID of this tag.",
  6872. "type": "integer",
  6873. "format": "int64",
  6874. "example": 12345
  6875. },
  6876. "name": {
  6877. "description": "Name of this tag.",
  6878. "type": "string",
  6879. "example": "Broken Vehicles"
  6880. }
  6881. }
  6882. },
  6883. "TagModify": {
  6884. "type": "object",
  6885. "properties": {
  6886. "add": {
  6887. "description": "Specify devices, etc. that should be added to the tag.",
  6888. "type": "object",
  6889. "properties": {
  6890. "assets": {
  6891. "description": "The assets to be added to this tag.",
  6892. "type": "array",
  6893. "items": {
  6894. "$ref": "#/definitions/TaggedAssetBase"
  6895. }
  6896. },
  6897. "drivers": {
  6898. "description": "The drivers to be added to this tag.",
  6899. "type": "array",
  6900. "items": {
  6901. "$ref": "#/definitions/TaggedDriverBase"
  6902. }
  6903. },
  6904. "machines": {
  6905. "description": "The machines to be added to this tag.",
  6906. "type": "array",
  6907. "items": {
  6908. "$ref": "#/definitions/TaggedMachineBase"
  6909. }
  6910. },
  6911. "sensors": {
  6912. "description": "The sensors to be added to this tag.",
  6913. "type": "array",
  6914. "items": {
  6915. "$ref": "#/definitions/TaggedSensorBase"
  6916. }
  6917. },
  6918. "vehicles": {
  6919. "description": "The vehicles to be added to this tag.",
  6920. "type": "array",
  6921. "items": {
  6922. "$ref": "#/definitions/TaggedVehicleBase"
  6923. }
  6924. }
  6925. }
  6926. },
  6927. "delete": {
  6928. "description": "Specify devices, etc. that should be removed from the tag.",
  6929. "type": "object",
  6930. "properties": {
  6931. "assets": {
  6932. "description": "The assets to be removed from this tag.",
  6933. "type": "array",
  6934. "items": {
  6935. "$ref": "#/definitions/TaggedAssetBase"
  6936. }
  6937. },
  6938. "drivers": {
  6939. "description": "The drivers to be removed from this tag.",
  6940. "type": "array",
  6941. "items": {
  6942. "$ref": "#/definitions/TaggedDriverBase"
  6943. }
  6944. },
  6945. "machines": {
  6946. "description": "The machines to be removed from this tag.",
  6947. "type": "array",
  6948. "items": {
  6949. "$ref": "#/definitions/TaggedMachineBase"
  6950. }
  6951. },
  6952. "sensors": {
  6953. "description": "The sensors to be removed from this tag.",
  6954. "type": "array",
  6955. "items": {
  6956. "$ref": "#/definitions/TaggedSensorBase"
  6957. }
  6958. },
  6959. "vehicles": {
  6960. "description": "The vehicles to be removed from this tag.",
  6961. "type": "array",
  6962. "items": {
  6963. "$ref": "#/definitions/TaggedVehicleBase"
  6964. }
  6965. }
  6966. }
  6967. },
  6968. "name": {
  6969. "description": "Updated name of this tag.",
  6970. "type": "string",
  6971. "example": "Broken Vehicles"
  6972. },
  6973. "parentTagId": {
  6974. "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.",
  6975. "type": "integer",
  6976. "format": "int64",
  6977. "example": 8389
  6978. }
  6979. }
  6980. },
  6981. "TagUpdate": {
  6982. "type": "object",
  6983. "properties": {
  6984. "assets": {
  6985. "description": "The assets that belong to this tag.",
  6986. "type": "array",
  6987. "items": {
  6988. "$ref": "#/definitions/TaggedAssetBase"
  6989. }
  6990. },
  6991. "drivers": {
  6992. "description": "The drivers that belong to this tag.",
  6993. "type": "array",
  6994. "items": {
  6995. "$ref": "#/definitions/TaggedDriverBase"
  6996. }
  6997. },
  6998. "machines": {
  6999. "description": "The machines that belong to this tag.",
  7000. "type": "array",
  7001. "items": {
  7002. "$ref": "#/definitions/TaggedMachineBase"
  7003. }
  7004. },
  7005. "name": {
  7006. "description": "Updated name of this tag.",
  7007. "type": "string",
  7008. "example": "Broken Vehicles"
  7009. },
  7010. "parentTagId": {
  7011. "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.",
  7012. "type": "integer",
  7013. "format": "int64",
  7014. "example": 8389
  7015. },
  7016. "sensors": {
  7017. "description": "The sensors that belong to this tag.",
  7018. "type": "array",
  7019. "items": {
  7020. "$ref": "#/definitions/TaggedSensorBase"
  7021. }
  7022. },
  7023. "vehicles": {
  7024. "description": "The vehicles that belong to this tag.",
  7025. "type": "array",
  7026. "items": {
  7027. "$ref": "#/definitions/TaggedVehicleBase"
  7028. }
  7029. }
  7030. }
  7031. },
  7032. "TaggedAddress": {
  7033. "allOf": [
  7034. {
  7035. "$ref": "#/definitions/TaggedAddressBase"
  7036. },
  7037. {
  7038. "type": "object",
  7039. "properties": {
  7040. "name": {
  7041. "description": "Name of the address being tagged.",
  7042. "type": "string",
  7043. "example": "Truck Lot 345"
  7044. }
  7045. }
  7046. }
  7047. ]
  7048. },
  7049. "TaggedAddressBase": {
  7050. "type": "object",
  7051. "required": [
  7052. "id"
  7053. ],
  7054. "properties": {
  7055. "id": {
  7056. "description": "The ID of the address being tagged.",
  7057. "type": "integer",
  7058. "format": "int64",
  7059. "example": 345
  7060. }
  7061. }
  7062. },
  7063. "TaggedAsset": {
  7064. "allOf": [
  7065. {
  7066. "$ref": "#/definitions/TaggedAssetBase"
  7067. },
  7068. {
  7069. "type": "object",
  7070. "properties": {
  7071. "name": {
  7072. "description": "Name of the Asset being tagged.",
  7073. "type": "string",
  7074. "example": "Trailer 789"
  7075. }
  7076. }
  7077. }
  7078. ]
  7079. },
  7080. "TaggedAssetBase": {
  7081. "type": "object",
  7082. "required": [
  7083. "id"
  7084. ],
  7085. "properties": {
  7086. "id": {
  7087. "description": "The ID of the Asset being tagged.",
  7088. "type": "integer",
  7089. "format": "int64",
  7090. "example": 789
  7091. }
  7092. }
  7093. },
  7094. "TaggedDriver": {
  7095. "allOf": [
  7096. {
  7097. "$ref": "#/definitions/TaggedDriverBase"
  7098. },
  7099. {
  7100. "type": "object",
  7101. "properties": {
  7102. "name": {
  7103. "description": "Name of the Driver being tagged.",
  7104. "type": "string",
  7105. "example": "John Smith"
  7106. }
  7107. }
  7108. }
  7109. ]
  7110. },
  7111. "TaggedDriverBase": {
  7112. "type": "object",
  7113. "required": [
  7114. "id"
  7115. ],
  7116. "properties": {
  7117. "id": {
  7118. "description": "The ID of the Driver being tagged.",
  7119. "type": "integer",
  7120. "format": "int64",
  7121. "example": 456
  7122. }
  7123. }
  7124. },
  7125. "TaggedMachine": {
  7126. "allOf": [
  7127. {
  7128. "$ref": "#/definitions/TaggedMachineBase"
  7129. },
  7130. {
  7131. "type": "object",
  7132. "properties": {
  7133. "name": {
  7134. "description": "Name of the Machine being tagged.",
  7135. "type": "string",
  7136. "example": "Vibration Monitor 567"
  7137. }
  7138. }
  7139. }
  7140. ]
  7141. },
  7142. "TaggedMachineBase": {
  7143. "type": "object",
  7144. "required": [
  7145. "id"
  7146. ],
  7147. "properties": {
  7148. "id": {
  7149. "description": "The ID of the Machine being tagged.",
  7150. "type": "integer",
  7151. "format": "int64",
  7152. "example": 567
  7153. }
  7154. }
  7155. },
  7156. "TaggedSensor": {
  7157. "allOf": [
  7158. {
  7159. "$ref": "#/definitions/TaggedSensorBase"
  7160. },
  7161. {
  7162. "type": "object",
  7163. "properties": {
  7164. "name": {
  7165. "description": "Name of the Sensor being tagged.",
  7166. "type": "string",
  7167. "example": "Temperature Sensor 345"
  7168. }
  7169. }
  7170. }
  7171. ]
  7172. },
  7173. "TaggedSensorBase": {
  7174. "type": "object",
  7175. "required": [
  7176. "id"
  7177. ],
  7178. "properties": {
  7179. "id": {
  7180. "description": "The ID of the Sensor being tagged.",
  7181. "type": "integer",
  7182. "format": "int64",
  7183. "example": 345
  7184. }
  7185. }
  7186. },
  7187. "TaggedVehicle": {
  7188. "allOf": [
  7189. {
  7190. "$ref": "#/definitions/TaggedVehicleBase"
  7191. },
  7192. {
  7193. "type": "object",
  7194. "properties": {
  7195. "name": {
  7196. "description": "Name of the Vehicle being tagged.",
  7197. "type": "string",
  7198. "example": "Heavy Duty 123"
  7199. }
  7200. }
  7201. }
  7202. ]
  7203. },
  7204. "TaggedVehicleBase": {
  7205. "type": "object",
  7206. "required": [
  7207. "id"
  7208. ],
  7209. "properties": {
  7210. "id": {
  7211. "description": "The ID of the Vehicle being tagged.",
  7212. "type": "integer",
  7213. "format": "int64",
  7214. "example": 123
  7215. }
  7216. }
  7217. },
  7218. "TemperatureResponse": {
  7219. "description": "Contains the current temperatures of a sensor.",
  7220. "type": "object",
  7221. "properties": {
  7222. "groupId": {
  7223. "type": "integer",
  7224. "format": "int64",
  7225. "example": 101
  7226. },
  7227. "sensors": {
  7228. "type": "array",
  7229. "items": {
  7230. "type": "object",
  7231. "properties": {
  7232. "ambientTemperature": {
  7233. "description": "Currently reported ambient temperature in millidegrees celsius.",
  7234. "type": "integer",
  7235. "example": 11057
  7236. },
  7237. "id": {
  7238. "description": "ID of the sensor.",
  7239. "type": "integer",
  7240. "format": "int64",
  7241. "example": 122
  7242. },
  7243. "name": {
  7244. "description": "Name of the sensor.",
  7245. "type": "string",
  7246. "example": "Freezer Temp Sensor"
  7247. },
  7248. "probeTemperature": {
  7249. "description": "Currently reported probe temperature in millidegrees celsius. If no probe is connected, this parameter will not be reported.",
  7250. "type": "integer",
  7251. "example": -20145
  7252. }
  7253. }
  7254. }
  7255. }
  7256. }
  7257. },
  7258. "TrailerAssignmentResponse": {
  7259. "type": "object",
  7260. "properties": {
  7261. "driverId": {
  7262. "description": "The ID of the driver associated with this trailer.",
  7263. "type": "integer",
  7264. "format": "int64",
  7265. "example": 2047
  7266. },
  7267. "endMs": {
  7268. "description": "The time at which the driver ended the assignment. If the assignment is current, this value will be omitted.",
  7269. "type": "integer",
  7270. "format": "int64",
  7271. "example": 1462881998034
  7272. },
  7273. "startMs": {
  7274. "description": "The time at which the driver started the assignment",
  7275. "type": "integer",
  7276. "format": "int64",
  7277. "example": 1462878398034
  7278. }
  7279. }
  7280. },
  7281. "TrailerAssignmentsResponse": {
  7282. "allOf": [
  7283. {
  7284. "$ref": "#/definitions/TrailerBase"
  7285. },
  7286. {
  7287. "type": "object",
  7288. "properties": {
  7289. "trailerAssignments": {
  7290. "type": "array",
  7291. "items": {
  7292. "$ref": "#/definitions/TrailerAssignmentResponse"
  7293. }
  7294. }
  7295. }
  7296. }
  7297. ]
  7298. },
  7299. "TrailerBase": {
  7300. "type": "object",
  7301. "required": [
  7302. "id",
  7303. "name"
  7304. ],
  7305. "properties": {
  7306. "id": {
  7307. "description": "ID of the trailer",
  7308. "type": "integer",
  7309. "format": "int64",
  7310. "example": 2041
  7311. },
  7312. "name": {
  7313. "description": "Assignment trailer name (given when creating trailer via the trailer portal)",
  7314. "type": "string",
  7315. "format": "string",
  7316. "example": "myTrailer"
  7317. }
  7318. }
  7319. },
  7320. "TripResponse": {
  7321. "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.",
  7322. "type": "object",
  7323. "properties": {
  7324. "trips": {
  7325. "type": "array",
  7326. "items": {
  7327. "type": "object",
  7328. "properties": {
  7329. "codriverIds": {
  7330. "description": "List of codriver IDs",
  7331. "type": "array",
  7332. "items": {
  7333. "type": "integer",
  7334. "format": "int64"
  7335. },
  7336. "example": [
  7337. 122
  7338. ]
  7339. },
  7340. "distanceMeters": {
  7341. "description": "Length of the trip in meters.",
  7342. "type": "integer",
  7343. "example": 2500
  7344. },
  7345. "driverId": {
  7346. "description": "ID of the driver.",
  7347. "type": "integer",
  7348. "example": 719
  7349. },
  7350. "endAddress": {
  7351. "description": "Text representation of nearest identifiable location to the end (latitude, longitude) coordinates.",
  7352. "type": "string",
  7353. "example": "Winchell's Donuts House"
  7354. },
  7355. "endCoordinates": {
  7356. "description": "End (latitude, longitude) in decimal degrees.",
  7357. "type": "object",
  7358. "properties": {
  7359. "latitude": {
  7360. "type": "number",
  7361. "format": "double",
  7362. "example": 23.413702345
  7363. },
  7364. "longitude": {
  7365. "type": "number",
  7366. "format": "double",
  7367. "example": -91.502888123
  7368. }
  7369. }
  7370. },
  7371. "endLocation": {
  7372. "description": "Geocoded street address of start (latitude, longitude) coordinates.",
  7373. "type": "string",
  7374. "example": "571 S Lake Ave, Pasadena, CA 91101"
  7375. },
  7376. "endMs": {
  7377. "description": "End of the trip in UNIX milliseconds.",
  7378. "type": "integer",
  7379. "example": 1462881998034
  7380. },
  7381. "endOdometer": {
  7382. "description": "Odometer reading (in meters) at the end of the trip.",
  7383. "type": "integer",
  7384. "example": 210430500
  7385. },
  7386. "fuelConsumedMl": {
  7387. "description": "Amount in milliliters of fuel consumed on this trip.",
  7388. "type": "integer",
  7389. "example": 75700
  7390. },
  7391. "startAddress": {
  7392. "description": "Text representation of nearest identifiable location to the start (latitude, longitude) coordinates.",
  7393. "type": "string",
  7394. "example": "Ramen Tatsunoya"
  7395. },
  7396. "startCoordinates": {
  7397. "description": "Start (latitude, longitude) in decimal degrees.",
  7398. "type": "object",
  7399. "properties": {
  7400. "latitude": {
  7401. "type": "number",
  7402. "format": "double",
  7403. "example": 29.443702345
  7404. },
  7405. "longitude": {
  7406. "type": "number",
  7407. "format": "double",
  7408. "example": -98.502888123
  7409. }
  7410. }
  7411. },
  7412. "startLocation": {
  7413. "description": "Geocoded street address of start (latitude, longitude) coordinates.",
  7414. "type": "string",
  7415. "example": "16 N Fair Oaks Ave, Pasadena, CA 91103"
  7416. },
  7417. "startMs": {
  7418. "description": "Beginning of the trip in UNIX milliseconds.",
  7419. "type": "integer",
  7420. "example": 1462878398034
  7421. },
  7422. "startOdometer": {
  7423. "description": "Odometer reading (in meters) at the beginning of the trip.",
  7424. "type": "integer",
  7425. "example": 210430450
  7426. },
  7427. "tollMeters": {
  7428. "description": "Length in meters trip spent on toll roads.",
  7429. "type": "integer",
  7430. "example": 32000
  7431. }
  7432. }
  7433. }
  7434. }
  7435. }
  7436. },
  7437. "UpsertUserBase": {
  7438. "type": "object",
  7439. "properties": {
  7440. "authType": {
  7441. "description": "The authentication type the user uses to authenticate. To use SAML this organization must have a configured SAML integration.",
  7442. "type": "string",
  7443. "enum": [
  7444. "default",
  7445. "saml"
  7446. ]
  7447. },
  7448. "name": {
  7449. "description": "The first and last name of the user.",
  7450. "type": "string",
  7451. "example": "Jane Doe"
  7452. },
  7453. "organizationRoleId": {
  7454. "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.",
  7455. "type": "string",
  7456. "example": "23d4d8d3-dc10-4e7a-a183-69968751f23e"
  7457. },
  7458. "tagRoles": {
  7459. "description": "If specified, the user will be an administrator for these tags. If left blank, the user has access to the entire organization.",
  7460. "type": "array",
  7461. "items": {
  7462. "type": "object",
  7463. "properties": {
  7464. "roleId": {
  7465. "description": "The id of the role",
  7466. "type": "string",
  7467. "example": "8a9371af-82d1-4158-bf91-4ecc8d3a114c"
  7468. },
  7469. "tagId": {
  7470. "description": "The id of the tag to grant this user access to.",
  7471. "type": "number",
  7472. "format": "int64",
  7473. "example": "123"
  7474. }
  7475. }
  7476. }
  7477. }
  7478. }
  7479. },
  7480. "User": {
  7481. "allOf": [
  7482. {
  7483. "$ref": "#/definitions/UserBase"
  7484. },
  7485. {
  7486. "type": "object",
  7487. "properties": {
  7488. "id": {
  7489. "description": "The ID of the User record.",
  7490. "type": "integer",
  7491. "format": "int64",
  7492. "example": 123
  7493. },
  7494. "organizationRole": {
  7495. "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.",
  7496. "type": "string",
  7497. "example": "Full Admin"
  7498. },
  7499. "tagRoles": {
  7500. "description": "The specific tags this user has access to. This will be blank for users that have full access to the organization.",
  7501. "type": "array",
  7502. "items": {
  7503. "$ref": "#/definitions/UserTagRole"
  7504. }
  7505. }
  7506. }
  7507. }
  7508. ]
  7509. },
  7510. "UserBase": {
  7511. "type": "object",
  7512. "required": [
  7513. "email",
  7514. "authType"
  7515. ],
  7516. "properties": {
  7517. "authType": {
  7518. "description": "The authentication type the user uses to authenticate. To use SAML this organization must have a configured SAML integration.",
  7519. "type": "string",
  7520. "enum": [
  7521. "default",
  7522. "saml"
  7523. ]
  7524. },
  7525. "email": {
  7526. "description": "The email address of this user.",
  7527. "type": "string",
  7528. "example": "user@company.com"
  7529. },
  7530. "name": {
  7531. "description": "The first and last name of the user.",
  7532. "type": "string",
  7533. "example": "Jane Doe"
  7534. },
  7535. "organizationRoleId": {
  7536. "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.",
  7537. "type": "string",
  7538. "example": "23d4d8d3-dc10-4e7a-a183-69968751f23e"
  7539. }
  7540. }
  7541. },
  7542. "UserRole": {
  7543. "type": "object",
  7544. "properties": {
  7545. "id": {
  7546. "type": "string",
  7547. "example": "8a9371af-82d1-4158-bf91-4ecc8d3a114c"
  7548. },
  7549. "name": {
  7550. "type": "string",
  7551. "example": "Full Admin"
  7552. }
  7553. }
  7554. },
  7555. "UserTagRole": {
  7556. "type": "object",
  7557. "required": [
  7558. "tag",
  7559. "roleId"
  7560. ],
  7561. "properties": {
  7562. "role": {
  7563. "description": "The name of the role the user has been granted on this tag.",
  7564. "type": "string",
  7565. "example": "Full Admin"
  7566. },
  7567. "roleId": {
  7568. "description": "The id of the role the user has been granted on this tag.",
  7569. "type": "string",
  7570. "example": "8a9371af-82d1-4158-bf91-4ecc8d3a114c"
  7571. },
  7572. "tag": {
  7573. "type": "object",
  7574. "required": [
  7575. "id",
  7576. "name"
  7577. ],
  7578. "properties": {
  7579. "id": {
  7580. "description": "The ID of this tag.",
  7581. "type": "integer",
  7582. "format": "int64",
  7583. "example": 12345
  7584. },
  7585. "name": {
  7586. "description": "Name of this tag.",
  7587. "type": "string",
  7588. "example": "North Carolina Distribution"
  7589. },
  7590. "parentTagId": {
  7591. "description": "The ID of this tag.",
  7592. "type": "integer",
  7593. "format": "int64",
  7594. "example": 12345
  7595. }
  7596. }
  7597. }
  7598. }
  7599. },
  7600. "Vehicle": {
  7601. "description": "A vehicle object.",
  7602. "type": "object",
  7603. "required": [
  7604. "id"
  7605. ],
  7606. "properties": {
  7607. "engineHours": {
  7608. "description": "Total engine hours for the vehicle.",
  7609. "type": "integer",
  7610. "format": "int64",
  7611. "example": 1500
  7612. },
  7613. "fuelLevelPercent": {
  7614. "description": "The fuel level of the vehicle as a percentage. (0.0 to 1.0)",
  7615. "type": "number",
  7616. "format": "float64",
  7617. "example": 0.3
  7618. },
  7619. "id": {
  7620. "description": "ID of the vehicle.",
  7621. "type": "integer",
  7622. "format": "int64",
  7623. "example": 112
  7624. },
  7625. "name": {
  7626. "description": "Name of the vehicle.",
  7627. "type": "string",
  7628. "example": "Truck A7"
  7629. },
  7630. "note": {
  7631. "type": "string",
  7632. "example": "Red truck 2015 M16"
  7633. },
  7634. "odometerMeters": {
  7635. "description": "The number of meters reported by the odometer.",
  7636. "type": "integer",
  7637. "format": "int64",
  7638. "example": 60130000
  7639. },
  7640. "tags": {
  7641. "type": "array",
  7642. "items": {
  7643. "$ref": "#/definitions/TagMetadata"
  7644. },
  7645. "x-omitempty": true
  7646. },
  7647. "vin": {
  7648. "description": "Vehicle Identification Number.",
  7649. "type": "string",
  7650. "example": "1FUJA6BD31LJ09646"
  7651. }
  7652. }
  7653. },
  7654. "VehicleHarshEventResponse": {
  7655. "description": "Harsh event details for a vehicle",
  7656. "type": "object",
  7657. "required": [
  7658. "incidentReportUrl",
  7659. "harshEventType"
  7660. ],
  7661. "properties": {
  7662. "downloadForwardVideoUrl": {
  7663. "description": "URL for downloading the forward facing video",
  7664. "type": "string",
  7665. "example": "https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-123456789.mp4?..."
  7666. },
  7667. "downloadInwardVideoUrl": {
  7668. "description": "URL for downloading the inward facing video",
  7669. "type": "string",
  7670. "example": "https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-driver-123456789.mp4?..."
  7671. },
  7672. "downloadTrackedInwardVideoUrl": {
  7673. "description": "URL for downloading the tracked inward facing video",
  7674. "type": "string",
  7675. "example": "https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-driver-123456789.tracked.mp4?..."
  7676. },
  7677. "harshEventType": {
  7678. "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]",
  7679. "type": "string",
  7680. "example": "Harsh Braking"
  7681. },
  7682. "incidentReportUrl": {
  7683. "description": "URL of the associated incident report page",
  7684. "type": "string",
  7685. "example": "https://cloud.samsara.com/groups/1234/fleet/reports/safety/vehicle/212123456789012/incident/1539201882984"
  7686. },
  7687. "isDistracted": {
  7688. "description": "Whether the driver was deemed distracted during this harsh event",
  7689. "type": "boolean",
  7690. "example": true
  7691. },
  7692. "location": {
  7693. "type": "object",
  7694. "properties": {
  7695. "address": {
  7696. "description": "Address of location where the harsh event occurred",
  7697. "type": "string",
  7698. "example": "350 Rhode Island St, San Francisco, CA"
  7699. },
  7700. "latitude": {
  7701. "description": "Latitude of location where the harsh event occurred",
  7702. "type": "string",
  7703. "example": "33.07614328"
  7704. },
  7705. "longitude": {
  7706. "description": "Longitude of location where the harsh event occurred",
  7707. "type": "string",
  7708. "example": "-96.14907287"
  7709. }
  7710. }
  7711. }
  7712. }
  7713. },
  7714. "VehicleLocation": {
  7715. "description": "Contains the location, in latitude and longitude, of a vehicle.",
  7716. "type": "object",
  7717. "required": [
  7718. "id"
  7719. ],
  7720. "properties": {
  7721. "driverId": {
  7722. "description": "The ID of the driver currently assigned to this vehicle.",
  7723. "type": "integer",
  7724. "example": 1
  7725. },
  7726. "heading": {
  7727. "description": "Heading in degrees.",
  7728. "type": "number",
  7729. "format": "double",
  7730. "example": 246.42
  7731. },
  7732. "id": {
  7733. "description": "ID of the vehicle.",
  7734. "type": "integer",
  7735. "format": "int64",
  7736. "example": 112
  7737. },
  7738. "latitude": {
  7739. "description": "Latitude in decimal degrees.",
  7740. "type": "number",
  7741. "format": "double",
  7742. "example": 123.456
  7743. },
  7744. "location": {
  7745. "description": "Text representation of nearest identifiable location to (latitude, longitude) coordinates.",
  7746. "type": "string",
  7747. "example": "1 Main St, Dallas, TX"
  7748. },
  7749. "longitude": {
  7750. "description": "Longitude in decimal degrees.",
  7751. "type": "number",
  7752. "format": "double",
  7753. "example": 32.897
  7754. },
  7755. "name": {
  7756. "description": "Name of the vehicle.",
  7757. "type": "string",
  7758. "example": "Truck A7"
  7759. },
  7760. "odometerMeters": {
  7761. "description": "The number of meters reported by the odometer.",
  7762. "type": "integer",
  7763. "format": "int64",
  7764. "example": 71774705
  7765. },
  7766. "onTrip": {
  7767. "description": "Whether or not a trip is currently in progress for this vehicle. More information available via /fleet/trips endpoint.",
  7768. "type": "boolean",
  7769. "example": true
  7770. },
  7771. "routeIds": {
  7772. "description": "A list of currently active route IDs that the vehicle is in.",
  7773. "type": "array",
  7774. "items": {
  7775. "type": "integer",
  7776. "format": "int64"
  7777. },
  7778. "example": [
  7779. 2244514,
  7780. 2311654
  7781. ]
  7782. },
  7783. "speed": {
  7784. "description": "Speed in miles per hour.",
  7785. "type": "number",
  7786. "format": "double",
  7787. "example": 64.37
  7788. },
  7789. "time": {
  7790. "description": "The time the reported location was logged, reported as a UNIX timestamp in milliseconds.",
  7791. "type": "integer",
  7792. "example": 1462881998034
  7793. },
  7794. "vin": {
  7795. "description": "Vehicle Identification Number (VIN) of the vehicle.",
  7796. "type": "string",
  7797. "example": "JTNBB46KX73011966"
  7798. }
  7799. }
  7800. },
  7801. "VehicleMaintenance": {
  7802. "description": "Contains any J1939/Passenger engine light warnings and engine faults.",
  7803. "type": "object",
  7804. "required": [
  7805. "id"
  7806. ],
  7807. "properties": {
  7808. "id": {
  7809. "description": "ID of the vehicle.",
  7810. "type": "integer",
  7811. "format": "int64",
  7812. "example": 112
  7813. },
  7814. "j1939": {
  7815. "description": "J1939 based data. Null if no data is available.",
  7816. "type": "object",
  7817. "properties": {
  7818. "checkEngineLight": {
  7819. "description": "J1939 check engine lights.",
  7820. "type": "object",
  7821. "properties": {
  7822. "emissionsIsOn": {
  7823. "type": "boolean"
  7824. },
  7825. "protectIsOn": {
  7826. "type": "boolean"
  7827. },
  7828. "stopIsOn": {
  7829. "type": "boolean"
  7830. },
  7831. "warningIsOn": {
  7832. "type": "boolean"
  7833. }
  7834. }
  7835. },
  7836. "diagnosticTroubleCodes": {
  7837. "description": "J1939 DTCs.",
  7838. "type": "array",
  7839. "items": {
  7840. "type": "object",
  7841. "required": [
  7842. "fmiId",
  7843. "fmiText",
  7844. "occurrenceCount",
  7845. "spnDescription",
  7846. "spnId",
  7847. "txId"
  7848. ],
  7849. "properties": {
  7850. "fmiId": {
  7851. "type": "integer"
  7852. },
  7853. "fmiText": {
  7854. "type": "string"
  7855. },
  7856. "occurrenceCount": {
  7857. "type": "integer"
  7858. },
  7859. "spnDescription": {
  7860. "type": "string"
  7861. },
  7862. "spnId": {
  7863. "type": "integer"
  7864. },
  7865. "txId": {
  7866. "type": "integer"
  7867. }
  7868. }
  7869. }
  7870. }
  7871. }
  7872. },
  7873. "passenger": {
  7874. "description": "Passenger vehicle data. Null if no data is available.",
  7875. "type": "object",
  7876. "properties": {
  7877. "checkEngineLight": {
  7878. "description": "Passenger vehicle check engine light.",
  7879. "type": "object",
  7880. "properties": {
  7881. "isOn": {
  7882. "type": "boolean"
  7883. }
  7884. }
  7885. },
  7886. "diagnosticTroubleCodes": {
  7887. "description": "Passenger vehicle DTCs.",
  7888. "type": "array",
  7889. "items": {
  7890. "type": "object",
  7891. "required": [
  7892. "dtcId",
  7893. "dtcDescription",
  7894. "dtcShortCode"
  7895. ],
  7896. "properties": {
  7897. "dtcDescription": {
  7898. "type": "string"
  7899. },
  7900. "dtcId": {
  7901. "type": "integer"
  7902. },
  7903. "dtcShortCode": {
  7904. "type": "string"
  7905. }
  7906. }
  7907. }
  7908. }
  7909. }
  7910. }
  7911. }
  7912. },
  7913. "VehicleSafetyScoreResponse": {
  7914. "description": "Safety score details for a vehicle",
  7915. "type": "object",
  7916. "properties": {
  7917. "crashCount": {
  7918. "description": "Crash event count",
  7919. "type": "integer",
  7920. "example": 0
  7921. },
  7922. "harshAccelCount": {
  7923. "description": "Harsh acceleration event count",
  7924. "type": "integer",
  7925. "example": 1
  7926. },
  7927. "harshBrakingCount": {
  7928. "description": "Harsh braking event count",
  7929. "type": "integer",
  7930. "example": 2
  7931. },
  7932. "harshEvents": {
  7933. "type": "array",
  7934. "items": {
  7935. "$ref": "#/definitions/SafetyReportHarshEvent"
  7936. }
  7937. },
  7938. "harshTurningCount": {
  7939. "description": "Harsh turning event count",
  7940. "type": "integer",
  7941. "example": 0
  7942. },
  7943. "safetyScore": {
  7944. "description": "Safety Score",
  7945. "type": "integer",
  7946. "example": 97
  7947. },
  7948. "safetyScoreRank": {
  7949. "description": "Safety Score Rank",
  7950. "type": "string",
  7951. "example": "26"
  7952. },
  7953. "timeOverSpeedLimitMs": {
  7954. "description": "Amount of time driven over the speed limit in milliseconds",
  7955. "type": "integer",
  7956. "example": 3769
  7957. },
  7958. "totalDistanceDrivenMeters": {
  7959. "description": "Total distance driven in meters",
  7960. "type": "integer",
  7961. "example": 291836
  7962. },
  7963. "totalHarshEventCount": {
  7964. "description": "Total harsh event count",
  7965. "type": "integer",
  7966. "example": 3
  7967. },
  7968. "totalTimeDrivenMs": {
  7969. "description": "Amount of time driven in milliseconds",
  7970. "type": "integer",
  7971. "example": 19708293
  7972. },
  7973. "vehicleId": {
  7974. "description": "Vehicle ID",
  7975. "type": "integer",
  7976. "example": 4321
  7977. }
  7978. }
  7979. },
  7980. "VisionCamerasResponse": {
  7981. "description": "Contains the list of Cameras installed in the org.",
  7982. "type": "array",
  7983. "items": {
  7984. "type": "object",
  7985. "properties": {
  7986. "cameraId": {
  7987. "type": "integer",
  7988. "format": "int64",
  7989. "example": 1234512345999
  7990. },
  7991. "cameraName": {
  7992. "type": "string",
  7993. "example": "Line 32"
  7994. },
  7995. "ethernetIp": {
  7996. "type": "string",
  7997. "example": "10.1.2.34"
  7998. },
  7999. "wifiIp": {
  8000. "type": "string",
  8001. "example": "10.1.2.35"
  8002. }
  8003. }
  8004. }
  8005. },
  8006. "VisionRunByCameraResponse": {
  8007. "type": "object",
  8008. "properties": {
  8009. "cameraId": {
  8010. "type": "integer",
  8011. "format": "int64",
  8012. "example": 1234512345123
  8013. },
  8014. "endedAtMs": {
  8015. "type": "integer",
  8016. "format": "int64",
  8017. "example": 0
  8018. },
  8019. "inspectionResults": {
  8020. "type": "array",
  8021. "items": {
  8022. "type": "object",
  8023. "properties": {
  8024. "captureAtMs": {
  8025. "type": "number",
  8026. "format": "float64",
  8027. "example": 1553811994730
  8028. },
  8029. "result": {
  8030. "type": "string",
  8031. "example": "PASS"
  8032. }
  8033. }
  8034. }
  8035. },
  8036. "isOnging": {
  8037. "type": "boolean",
  8038. "example": true
  8039. },
  8040. "program": {
  8041. "type": "object",
  8042. "properties": {
  8043. "id": {
  8044. "type": "integer",
  8045. "format": "int64",
  8046. "example": 1
  8047. },
  8048. "name": {
  8049. "type": "string",
  8050. "example": "Barcode verification program"
  8051. }
  8052. }
  8053. },
  8054. "runSummary": {
  8055. "type": "object",
  8056. "properties": {
  8057. "itemsPerMinute": {
  8058. "type": "number",
  8059. "format": "float64",
  8060. "example": 0.1
  8061. },
  8062. "noReadCount": {
  8063. "type": "integer",
  8064. "format": "int64",
  8065. "example": 0
  8066. },
  8067. "rejectCount": {
  8068. "type": "integer",
  8069. "format": "int64",
  8070. "example": 0
  8071. },
  8072. "successCount": {
  8073. "type": "integer",
  8074. "format": "int64",
  8075. "example": 181
  8076. }
  8077. }
  8078. },
  8079. "startedAtMs": {
  8080. "type": "integer",
  8081. "format": "int64",
  8082. "example": 1553808606097
  8083. }
  8084. }
  8085. },
  8086. "VisionRunsByCameraResponse": {
  8087. "type": "array",
  8088. "items": {
  8089. "type": "object",
  8090. "properties": {
  8091. "deviceId": {
  8092. "type": "integer",
  8093. "format": "int64",
  8094. "example": 1234512345123
  8095. },
  8096. "endedAtMs": {
  8097. "type": "integer",
  8098. "format": "int64",
  8099. "example": 0
  8100. },
  8101. "program": {
  8102. "type": "object",
  8103. "properties": {
  8104. "id": {
  8105. "type": "integer",
  8106. "format": "int64",
  8107. "example": 1
  8108. },
  8109. "name": {
  8110. "type": "string",
  8111. "example": "Barcode verification program"
  8112. }
  8113. }
  8114. },
  8115. "reportMetadata": {
  8116. "type": "object",
  8117. "properties": {
  8118. "itemsPerMinute": {
  8119. "type": "number",
  8120. "format": "float64",
  8121. "example": 0.1
  8122. },
  8123. "noReadCount": {
  8124. "type": "integer",
  8125. "format": "int64",
  8126. "example": 0
  8127. },
  8128. "rejectCount": {
  8129. "type": "integer",
  8130. "format": "int64",
  8131. "example": 0
  8132. },
  8133. "successCount": {
  8134. "type": "integer",
  8135. "format": "int64",
  8136. "example": 181
  8137. }
  8138. }
  8139. },
  8140. "startedAtMs": {
  8141. "type": "integer",
  8142. "format": "int64",
  8143. "example": 1553808606097
  8144. }
  8145. }
  8146. }
  8147. },
  8148. "VisionRunsResponse": {
  8149. "type": "object",
  8150. "properties": {
  8151. "visionRuns": {
  8152. "type": "array",
  8153. "items": {
  8154. "type": "object",
  8155. "properties": {
  8156. "deviceId": {
  8157. "type": "integer",
  8158. "format": "int64",
  8159. "example": 1234512345123
  8160. },
  8161. "endedAtMs": {
  8162. "type": "integer",
  8163. "format": "int64",
  8164. "example": 0
  8165. },
  8166. "programId": {
  8167. "type": "integer",
  8168. "format": "int64",
  8169. "example": 1
  8170. },
  8171. "reportMetadata": {
  8172. "type": "object",
  8173. "properties": {
  8174. "failedScansCount": {
  8175. "type": "integer",
  8176. "format": "int64",
  8177. "example": 0
  8178. },
  8179. "noReadScansCount": {
  8180. "type": "integer",
  8181. "format": "int64",
  8182. "example": 181
  8183. },
  8184. "scanRate": {
  8185. "type": "number",
  8186. "format": "float64",
  8187. "example": 0.1
  8188. },
  8189. "successfulScansCount": {
  8190. "type": "integer",
  8191. "format": "int64",
  8192. "example": 181
  8193. }
  8194. }
  8195. },
  8196. "startedAtMs": {
  8197. "type": "integer",
  8198. "format": "int64",
  8199. "example": 1553808606097
  8200. }
  8201. }
  8202. }
  8203. }
  8204. }
  8205. },
  8206. "allRouteJobUpdates": {
  8207. "type": "object",
  8208. "properties": {
  8209. "job_updates": {
  8210. "type": "array",
  8211. "items": {
  8212. "$ref": "#/definitions/jobUpdateObject"
  8213. }
  8214. },
  8215. "sequence_id": {
  8216. "description": "Sequence ID of the last update returned in the response",
  8217. "type": "string",
  8218. "example": "eyJpZCI6MywiY3JlYXRlZF9hdCI6MTQ5OTQyOTIyMDAwMn0="
  8219. }
  8220. }
  8221. },
  8222. "jobStatus": {
  8223. "description": "The current state of the dispatch job.",
  8224. "type": "string",
  8225. "enum": [
  8226. "JobState_Unassigned",
  8227. "JobState_Scheduled",
  8228. "JobState_EnRoute",
  8229. "JobState_Arrived",
  8230. "JobState_Completed",
  8231. "JobState_Skipped"
  8232. ],
  8233. "example": "JobState_Arrived"
  8234. },
  8235. "jobUpdateObject": {
  8236. "type": "object",
  8237. "properties": {
  8238. "changed_at_ms": {
  8239. "description": "Timestamp that this event was updated, represented as Unix milliseconds since epoch.",
  8240. "type": "integer",
  8241. "format": "int64",
  8242. "example": 1462881998034
  8243. },
  8244. "job_id": {
  8245. "description": "ID of the Samsara job.",
  8246. "type": "integer",
  8247. "format": "int64",
  8248. "example": 773
  8249. },
  8250. "job_state": {
  8251. "$ref": "#/definitions/jobStatus"
  8252. },
  8253. "prev_job_state": {
  8254. "$ref": "#/definitions/prevJobStatus"
  8255. },
  8256. "route": {
  8257. "$ref": "#/definitions/DispatchRoute"
  8258. },
  8259. "route_id": {
  8260. "description": "ID of the Samsara dispatch route.",
  8261. "type": "integer",
  8262. "format": "int64",
  8263. "example": 556
  8264. }
  8265. }
  8266. },
  8267. "prevJobStatus": {
  8268. "description": "The previous state of the dispatch job.",
  8269. "type": "string",
  8270. "enum": [
  8271. "JobState_Unassigned",
  8272. "JobState_Scheduled",
  8273. "JobState_EnRoute",
  8274. "JobState_Arrived",
  8275. "JobState_Completed",
  8276. "JobState_Skipped"
  8277. ],
  8278. "example": "JobState_EnRoute"
  8279. }
  8280. },
  8281. "parameters": {
  8282. "accessTokenParam": {
  8283. "type": "string",
  8284. "description": "Samsara API access token.",
  8285. "name": "access_token",
  8286. "in": "query",
  8287. "required": true
  8288. },
  8289. "addContactParam": {
  8290. "description": "Add a contact",
  8291. "name": "contact",
  8292. "in": "body",
  8293. "required": true,
  8294. "schema": {
  8295. "$ref": "#/definitions/ContactInput"
  8296. }
  8297. },
  8298. "addressAddParam": {
  8299. "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.",
  8300. "name": "addresses",
  8301. "in": "body",
  8302. "required": true,
  8303. "schema": {
  8304. "type": "object",
  8305. "required": [
  8306. "addresses"
  8307. ],
  8308. "properties": {
  8309. "addresses": {
  8310. "type": "array",
  8311. "items": {
  8312. "type": "object",
  8313. "required": [
  8314. "name",
  8315. "formattedAddress",
  8316. "geofence"
  8317. ],
  8318. "properties": {
  8319. "contactIds": {
  8320. "$ref": "#/definitions/ContactIds"
  8321. },
  8322. "formattedAddress": {
  8323. "description": "The full address associated with this address/geofence, as it might be recognized by maps.google.com",
  8324. "type": "string",
  8325. "example": "350 Rhode Island St, San Francisco, CA"
  8326. },
  8327. "geofence": {
  8328. "$ref": "#/definitions/AddressGeofence"
  8329. },
  8330. "name": {
  8331. "description": "The name of this address/geofence",
  8332. "type": "string",
  8333. "example": "Samsara HQ"
  8334. },
  8335. "notes": {
  8336. "$ref": "#/definitions/AddressNotes"
  8337. },
  8338. "tagIds": {
  8339. "$ref": "#/definitions/TagIds"
  8340. }
  8341. }
  8342. }
  8343. }
  8344. }
  8345. }
  8346. },
  8347. "addressUpdateParam": {
  8348. "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.",
  8349. "name": "address",
  8350. "in": "body",
  8351. "required": true,
  8352. "schema": {
  8353. "type": "object",
  8354. "properties": {
  8355. "contactIds": {
  8356. "$ref": "#/definitions/ContactIds"
  8357. },
  8358. "formattedAddress": {
  8359. "description": "The full address associated with this address/geofence, as it might be recognized by maps.google.com",
  8360. "type": "string",
  8361. "example": "350 Rhode Island St, San Francisco, CA"
  8362. },
  8363. "geofence": {
  8364. "$ref": "#/definitions/AddressGeofence"
  8365. },
  8366. "name": {
  8367. "description": "The name of this address/geofence",
  8368. "type": "string",
  8369. "example": "Samsara HQ"
  8370. },
  8371. "notes": {
  8372. "$ref": "#/definitions/AddressNotes"
  8373. },
  8374. "tagIds": {
  8375. "$ref": "#/definitions/TagIds"
  8376. }
  8377. }
  8378. }
  8379. },
  8380. "assetHistoryEndTimeParam": {
  8381. "type": "integer",
  8382. "format": "int64",
  8383. "description": "Timestamp in milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs.",
  8384. "name": "endMs",
  8385. "in": "query",
  8386. "required": true
  8387. },
  8388. "assetHistoryStartTimeParam": {
  8389. "type": "integer",
  8390. "format": "int64",
  8391. "description": "Timestamp in milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs.",
  8392. "name": "startMs",
  8393. "in": "query",
  8394. "required": true
  8395. },
  8396. "assetIdParam": {
  8397. "type": "integer",
  8398. "format": "int64",
  8399. "description": "ID of the asset. Must contain only digits 0-9.",
  8400. "name": "asset_id",
  8401. "in": "path",
  8402. "required": true
  8403. },
  8404. "createDriverParam": {
  8405. "description": "Driver creation body",
  8406. "name": "createDriverParam",
  8407. "in": "body",
  8408. "required": true,
  8409. "schema": {
  8410. "$ref": "#/definitions/DriverForCreate"
  8411. }
  8412. },
  8413. "createDvirParam": {
  8414. "description": "DVIR creation body",
  8415. "name": "createDvirParam",
  8416. "in": "body",
  8417. "required": true,
  8418. "schema": {
  8419. "type": "object",
  8420. "required": [
  8421. "safe",
  8422. "inspectionType",
  8423. "userEmail"
  8424. ],
  8425. "properties": {
  8426. "inspectionType": {
  8427. "description": "Only type 'mechanic' is currently accepted.",
  8428. "type": "string",
  8429. "enum": [
  8430. "mechanic"
  8431. ],
  8432. "example": "mechanic"
  8433. },
  8434. "mechanicNotes": {
  8435. "description": "Any notes from the mechanic.",
  8436. "type": "string",
  8437. "example": "Replaced headlight on passenger side."
  8438. },
  8439. "odometerMiles": {
  8440. "description": "The current odometer of the vehicle.",
  8441. "type": "integer",
  8442. "example": 38426
  8443. },
  8444. "previousDefectsCorrected": {
  8445. "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.",
  8446. "type": "boolean",
  8447. "example": true
  8448. },
  8449. "previousDefectsIgnored": {
  8450. "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.",
  8451. "type": "boolean",
  8452. "example": false
  8453. },
  8454. "safe": {
  8455. "description": "Whether or not this vehicle or trailer is safe to drive.",
  8456. "type": "string",
  8457. "enum": [
  8458. "safe",
  8459. "unsafe"
  8460. ],
  8461. "example": "safe"
  8462. },
  8463. "trailerId": {
  8464. "description": "Id of trailer being inspected. Either vehicleId or trailerId must be provided.",
  8465. "type": "integer",
  8466. "example": 11
  8467. },
  8468. "userEmail": {
  8469. "description": "The Samsara login email for the person creating the DVIR. The email must correspond to a Samsara user's email.",
  8470. "type": "string",
  8471. "example": "j.smith@yahoo.com"
  8472. },
  8473. "vehicleId": {
  8474. "description": "Id of vehicle being inspected. Either vehicleId or trailerId must be provided.",
  8475. "type": "integer",
  8476. "example": 10
  8477. }
  8478. }
  8479. }
  8480. },
  8481. "createMessagesParam": {
  8482. "description": "Text to send to a list of driverIds.",
  8483. "name": "createMessages",
  8484. "in": "body",
  8485. "required": true,
  8486. "schema": {
  8487. "type": "object",
  8488. "required": [
  8489. "driverIds",
  8490. "text"
  8491. ],
  8492. "properties": {
  8493. "driverIds": {
  8494. "description": "IDs of the drivers for whom the messages are sent to.",
  8495. "type": "array",
  8496. "items": {
  8497. "type": "number",
  8498. "format": "int64",
  8499. "example": 555
  8500. },
  8501. "example": [
  8502. 111,
  8503. 222,
  8504. 333
  8505. ]
  8506. },
  8507. "text": {
  8508. "description": "The text sent in the message.",
  8509. "type": "string",
  8510. "example": "This is a message."
  8511. }
  8512. }
  8513. }
  8514. },
  8515. "createUserParam": {
  8516. "description": "User properties. Only one of organizationRoleId or tagRoles is required.",
  8517. "name": "user",
  8518. "in": "body",
  8519. "required": true,
  8520. "schema": {
  8521. "type": "object",
  8522. "required": [
  8523. "name",
  8524. "email",
  8525. "authType"
  8526. ],
  8527. "allOf": [
  8528. {
  8529. "$ref": "#/definitions/UpsertUserBase"
  8530. },
  8531. {
  8532. "type": "object",
  8533. "properties": {
  8534. "email": {
  8535. "description": "The email address of this user.",
  8536. "type": "string",
  8537. "example": "user@company.com"
  8538. }
  8539. }
  8540. }
  8541. ]
  8542. }
  8543. },
  8544. "dataInputEndTimeParam": {
  8545. "type": "integer",
  8546. "format": "int64",
  8547. "description": "Timestamp in unix milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs. Defaults to nowMs.",
  8548. "name": "endMs",
  8549. "in": "query"
  8550. },
  8551. "dataInputIdParam": {
  8552. "type": "integer",
  8553. "format": "int64",
  8554. "description": "ID of the data input. Must contain only digits 0-9.",
  8555. "name": "data_input_id",
  8556. "in": "path",
  8557. "required": true
  8558. },
  8559. "dataInputStartTimeParam": {
  8560. "type": "integer",
  8561. "format": "int64",
  8562. "description": "Timestamp in unix milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs. defaults to nowMs.",
  8563. "name": "startMs",
  8564. "in": "query"
  8565. },
  8566. "documentCreateParam": {
  8567. "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_.",
  8568. "name": "createDocumentParams",
  8569. "in": "body",
  8570. "required": true,
  8571. "schema": {
  8572. "$ref": "#/definitions/DocumentCreate"
  8573. }
  8574. },
  8575. "documentsDurationMsParam": {
  8576. "type": "integer",
  8577. "format": "int64",
  8578. "description": "Time in milliseconds that represents the duration before endMs to query. Defaults to 24 hours.",
  8579. "name": "durationMs",
  8580. "in": "query"
  8581. },
  8582. "documentsEndMsParam": {
  8583. "type": "integer",
  8584. "format": "int64",
  8585. "description": "Time in unix milliseconds that represents the oldest documents to return. Used in combination with durationMs. Defaults to now.",
  8586. "name": "endMs",
  8587. "in": "query"
  8588. },
  8589. "driverIdOrExternalIdParam": {
  8590. "type": "string",
  8591. "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.",
  8592. "name": "driver_id_or_external_id",
  8593. "in": "path",
  8594. "required": true
  8595. },
  8596. "getMessagesDurationMsParam": {
  8597. "type": "integer",
  8598. "format": "int64",
  8599. "description": "Time in milliseconds that represents the duration before endMs to query. Defaults to 24 hours.",
  8600. "name": "durationMs",
  8601. "in": "query"
  8602. },
  8603. "getMessagesEndMsParam": {
  8604. "type": "integer",
  8605. "format": "int64",
  8606. "description": "Time in unix milliseconds that represents the end of time range of messages to return. Used in combination with durationMs. Defaults to now.",
  8607. "name": "endMs",
  8608. "in": "query"
  8609. },
  8610. "groupIdBodyParam": {
  8611. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  8612. "name": "groupIdBodyParam",
  8613. "in": "body",
  8614. "schema": {
  8615. "type": "object",
  8616. "required": [
  8617. "groupId"
  8618. ],
  8619. "properties": {
  8620. "groupId": {
  8621. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  8622. "type": "integer",
  8623. "format": "int64",
  8624. "example": 101
  8625. }
  8626. }
  8627. }
  8628. },
  8629. "groupIdParam": {
  8630. "type": "integer",
  8631. "format": "int64",
  8632. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  8633. "name": "group_id",
  8634. "in": "query"
  8635. },
  8636. "groupIdQueryParam": {
  8637. "type": "integer",
  8638. "format": "int64",
  8639. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  8640. "name": "groupId",
  8641. "in": "query"
  8642. },
  8643. "harshEventMsParam": {
  8644. "type": "integer",
  8645. "format": "int64",
  8646. "description": "Timestamp in milliseconds representing the timestamp of a harsh event.",
  8647. "name": "timestamp",
  8648. "in": "query",
  8649. "required": true
  8650. },
  8651. "jobUpdatesIncludeParam": {
  8652. "type": "string",
  8653. "description": "Optionally set include=route to include route object in response payload.",
  8654. "name": "include",
  8655. "in": "query"
  8656. },
  8657. "lastReceivedSequenceIDParam": {
  8658. "type": "string",
  8659. "description": "Sequence ID from the response payload of the last request. Defaults to fetching updates from last 24 hours.",
  8660. "name": "sequence_id",
  8661. "in": "query"
  8662. },
  8663. "paginationEndingBeforeParam": {
  8664. "type": "string",
  8665. "description": "Pagination parameter indicating the cursor position to return results before. Used in conjunction with the 'limit' parameter. Mutually exclusive with 'startingAfter' parameter.",
  8666. "name": "endingBefore",
  8667. "in": "query"
  8668. },
  8669. "paginationLimitParam": {
  8670. "type": "number",
  8671. "format": "int64",
  8672. "description": "Pagination parameter indicating the number of results to return in this request. Used in conjunction with either 'startingAfter' or 'endingBefore'.",
  8673. "name": "limit",
  8674. "in": "query"
  8675. },
  8676. "paginationStartingAfterParam": {
  8677. "type": "string",
  8678. "description": "Pagination parameter indicating the cursor position to continue returning results after. Used in conjunction with the 'limit' parameter. Mutually exclusive with 'endingBefore' parameter.",
  8679. "name": "startingAfter",
  8680. "in": "query"
  8681. },
  8682. "reactivateDriverParam": {
  8683. "description": "Driver reactivation body",
  8684. "name": "reactivateDriverParam",
  8685. "in": "body",
  8686. "required": true,
  8687. "schema": {
  8688. "type": "object",
  8689. "required": [
  8690. "reactivate"
  8691. ],
  8692. "properties": {
  8693. "reactivate": {
  8694. "description": "True indicates that this driver should be reactivated.",
  8695. "type": "boolean"
  8696. }
  8697. }
  8698. }
  8699. },
  8700. "routeCreateParam": {
  8701. "name": "createDispatchRouteParams",
  8702. "in": "body",
  8703. "required": true,
  8704. "schema": {
  8705. "$ref": "#/definitions/DispatchRouteCreate"
  8706. }
  8707. },
  8708. "routeDurationParam": {
  8709. "type": "integer",
  8710. "format": "int64",
  8711. "description": "Time in milliseconds that represents the duration before end_time to query. Defaults to 24 hours.",
  8712. "name": "duration",
  8713. "in": "query"
  8714. },
  8715. "routeEndTimeParam": {
  8716. "type": "integer",
  8717. "format": "int64",
  8718. "description": "Time in unix milliseconds that represents the oldest routes to return. Used in combination with duration. Defaults to now.",
  8719. "name": "end_time",
  8720. "in": "query"
  8721. },
  8722. "routeHistoryEndTimeParam": {
  8723. "type": "integer",
  8724. "format": "int64",
  8725. "description": "Timestamp representing the end of the period to fetch, inclusive. Used in combination with start_time. Defaults to nowMs.",
  8726. "name": "end_time",
  8727. "in": "query"
  8728. },
  8729. "routeHistoryStartTimeParam": {
  8730. "type": "integer",
  8731. "format": "int64",
  8732. "description": "Timestamp representing the start of the period to fetch, inclusive. Used in combination with end_time. Defaults to 0.",
  8733. "name": "start_time",
  8734. "in": "query"
  8735. },
  8736. "routeUpdateParam": {
  8737. "name": "updateDispatchRouteParams",
  8738. "in": "body",
  8739. "required": true,
  8740. "schema": {
  8741. "$ref": "#/definitions/DispatchRouteUpdate"
  8742. }
  8743. },
  8744. "safetyScoreEndMsParam": {
  8745. "type": "integer",
  8746. "format": "int64",
  8747. "description": "Timestamp in milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs.",
  8748. "name": "endMs",
  8749. "in": "query",
  8750. "required": true
  8751. },
  8752. "safetyScoreStartMsParam": {
  8753. "type": "integer",
  8754. "format": "int64",
  8755. "description": "Timestamp in milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs.",
  8756. "name": "startMs",
  8757. "in": "query",
  8758. "required": true
  8759. },
  8760. "sensorParam": {
  8761. "description": "Group ID and list of sensor IDs to query.",
  8762. "name": "sensorParam",
  8763. "in": "body",
  8764. "required": true,
  8765. "schema": {
  8766. "type": "object",
  8767. "required": [
  8768. "groupId",
  8769. "sensors"
  8770. ],
  8771. "properties": {
  8772. "groupId": {
  8773. "description": "Optional group ID if the organization has multiple groups (uncommon).",
  8774. "type": "integer",
  8775. "format": "int64",
  8776. "example": 101
  8777. },
  8778. "sensors": {
  8779. "description": "List of sensor IDs to query.",
  8780. "type": "array",
  8781. "items": {
  8782. "type": "integer",
  8783. "format": "int64"
  8784. },
  8785. "example": [
  8786. 122
  8787. ]
  8788. }
  8789. }
  8790. }
  8791. },
  8792. "tagCreateParam": {
  8793. "name": "tagCreateParams",
  8794. "in": "body",
  8795. "required": true,
  8796. "schema": {
  8797. "$ref": "#/definitions/TagCreate"
  8798. }
  8799. },
  8800. "tagModifyParam": {
  8801. "name": "tagModifyParams",
  8802. "in": "body",
  8803. "required": true,
  8804. "schema": {
  8805. "$ref": "#/definitions/TagModify"
  8806. }
  8807. },
  8808. "tagPathParam": {
  8809. "type": "integer",
  8810. "format": "int64",
  8811. "description": "ID of the tag. Must contain only digits 0-9.",
  8812. "name": "tag_id",
  8813. "in": "path",
  8814. "required": true
  8815. },
  8816. "tagUpdateParam": {
  8817. "name": "updateTagParams",
  8818. "in": "body",
  8819. "required": true,
  8820. "schema": {
  8821. "$ref": "#/definitions/TagUpdate"
  8822. }
  8823. },
  8824. "updateContactParam": {
  8825. "description": "Update parts of a contact",
  8826. "name": "contact",
  8827. "in": "body",
  8828. "required": true,
  8829. "schema": {
  8830. "$ref": "#/definitions/ContactInput"
  8831. }
  8832. },
  8833. "updateDriverParam": {
  8834. "description": "Driver update body",
  8835. "name": "updateDriverParam",
  8836. "in": "body",
  8837. "required": true,
  8838. "schema": {
  8839. "$ref": "#/definitions/DriverForUpdate"
  8840. }
  8841. },
  8842. "updateUserParam": {
  8843. "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.",
  8844. "name": "user",
  8845. "in": "body",
  8846. "required": true,
  8847. "schema": {
  8848. "$ref": "#/definitions/UpsertUserBase"
  8849. }
  8850. },
  8851. "vehicleIdOrExternalIdParam": {
  8852. "type": "string",
  8853. "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.",
  8854. "name": "vehicle_id_or_external_id",
  8855. "in": "path",
  8856. "required": true
  8857. },
  8858. "visionCameraIdParam": {
  8859. "type": "integer",
  8860. "format": "int64",
  8861. "description": "The camera_id should be valid for the given accessToken.",
  8862. "name": "camera_id",
  8863. "in": "path",
  8864. "required": true
  8865. },
  8866. "visionDurationMsParam": {
  8867. "type": "integer",
  8868. "format": "int64",
  8869. "description": "DurationMs is a required param. This works with the EndMs parameter. Indicates the duration in which the visionRuns will be fetched",
  8870. "name": "durationMs",
  8871. "in": "query",
  8872. "required": true
  8873. },
  8874. "visionEndMsParam": {
  8875. "type": "integer",
  8876. "format": "int64",
  8877. "description": "EndMs is an optional param. It will default to the current time.",
  8878. "name": "endMs",
  8879. "in": "query"
  8880. },
  8881. "visionIncludeParam": {
  8882. "type": "string",
  8883. "description": "Include is a filter parameter. Accepts 'pass', 'reject' or 'no_read'.",
  8884. "name": "include",
  8885. "in": "query"
  8886. },
  8887. "visionLimitParam": {
  8888. "type": "integer",
  8889. "format": "int64",
  8890. "description": "Limit is an integer value from 1 to 1,000.",
  8891. "name": "limit",
  8892. "in": "query"
  8893. },
  8894. "visionProgramIdParam": {
  8895. "type": "integer",
  8896. "format": "int64",
  8897. "description": "The configured program's ID on the camera.",
  8898. "name": "program_id",
  8899. "in": "query"
  8900. },
  8901. "visionStartAtMsParam": {
  8902. "type": "integer",
  8903. "format": "int64",
  8904. "description": "EndMs is an optional param. It will default to the current time.",
  8905. "name": "startedAtMs",
  8906. "in": "query"
  8907. }
  8908. },
  8909. "tags": [
  8910. {
  8911. "description": "Access to fleet data",
  8912. "name": "Fleet"
  8913. },
  8914. {
  8915. "description": "Access to industrial data",
  8916. "name": "Industrial"
  8917. },
  8918. {
  8919. "description": "Access to sensor data",
  8920. "name": "Sensors"
  8921. },
  8922. {
  8923. "description": "Access to asset specific data",
  8924. "name": "Assets"
  8925. },
  8926. {
  8927. "description": "Access to safety specific data",
  8928. "name": "Safety"
  8929. },
  8930. {
  8931. "description": "Access to user data",
  8932. "name": "Users"
  8933. }
  8934. ]
  8935. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement