### Example FFmpeg Command for Video Clipping Source: https://driver-gateway.readme.io/reference/get_video_download_urls-1 Provides an example `ffmpeg` command for advanced users to manually control video muxing and encoding. This command uses the `offset` from the response to trim video segments into a single MP4 file. ```Shell ffmpeg -ss {offset} -i {concat:init.mp4|segment_n.m4s|segment_n+1.m4s} -t {duration} -f mp4 -c copy video.mp4 ``` -------------------------------- ### GET /drives Source: https://driver-gateway.readme.io/reference/get_drives-1 Retrieves a list of drives, with options to filter by organization, start location, event types, and video/audio availability. ```APIDOC ## GET /drives ### Description Retrieves a list of drives. This endpoint supports filtering based on various criteria such as organization ID, start areas and countries, specific event types, and the presence of exterior HD video or audio. ### Method GET ### Endpoint /drives ### Parameters #### Query Parameters - **organization_id** (string) - Optional - Filters drives by a specific organization. - **start_areas** (array of strings) - Optional - Filters drives by an array of start areas (e.g., US states). Example: `?start_areas[]=MN&start_areas[]=RI`. Note: Include `[]` after the key for array parameters. - **start_countries** (array of strings) - Optional - Filters drives by an array of start countries (e.g., world country codes). Example: `?start_countries[]=US&start_countries[]=UA`. Note: Include `[]` after the key for array parameters. - **including_any_event** (array of strings) - Optional - Filters drives by an array of event types. Possible values include: `CUSTOM_IMU_HARD_ACCELERATION`, `CUSTOM_IMU_HARD_BRAKING`, `HARD_BRAKING`, `HARD_ACCELERATION`, `HIGH_SPEED`, `ECO_DRIVING`, `IMU_ACCELERATION`, `IMU_BRAKING`, `IMU_TURNING`, `IMU_HARD_ACCELERATION`, `IMU_HARD_BRAKING`, `IMU_HARD_TURNING`, `RAN_STOP_SIGN`, `TAILGATING`, `NEAR_ACCIDENT`, `SCREEN_TAP`, `FORWARD_COLLISION_ALERT`, `DROWSY_DRIVING_ALERT`, `DISTRACTED_DRIVING_ALERT`, `SPEED_OVER_LIMIT`. Example: `?including_any_event[]=HIGH_SPEED&including_any_event[]=HARD_BRAKING`. Note: Include `[]` after the key for array parameters. - **with_exterior_hd_video** (boolean) - Optional - Limits results to drives with fully synced exterior HD video (true/false). - **with_audio** (boolean) - Optional - Limits results to drives with audio (true/false). ### Request Example ``` GET /drives?organization_id=e4d8c777-5101-4206-88f4-f4fa32e8ad6b&start_areas[]=MN&including_any_event[]=HIGH_SPEED&with_exterior_hd_video=true ``` ### Response #### Success Response (200) - **drives** (array) - An array of drive objects. - **drive_id** (string) - The unique identifier for the drive. - **start_time** (string) - The start time of the drive in ISO 8601 format. - **end_time** (string) - The end time of the drive in ISO 8601 format. - **metadata** (object) - Contains metadata about the drive, such as vehicle information and driver details. #### Response Example ```json { "drives": [ { "drive_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:30:00Z", "metadata": { "vehicle_id": "veh-123", "driver_id": "drv-456" } } ] } ``` ``` -------------------------------- ### GET /gateway/v1/users/{user_id}/drives/{drive_id}/video-upload-url Source: https://driver-gateway.readme.io/reference/get_video_upload_url-1 Generates a presigned URL for uploading a video to be attached to a specific drive. This URL is single-use and the video must be uploaded before the drive is finalized. It supports only one video per drive and requires the video's start and end times to align with the drive's times for proper display in DriverCloud. ```APIDOC ## GET /gateway/v1/users/{user_id}/drives/{drive_id}/video-upload-url ### Description Generates a presigned URL for uploading a video to be attached to a specific drive. This URL is single-use and the video must be uploaded before the drive is finalized. It supports only one video per drive and requires the video's start and end times to align with the drive's times for proper display in DriverCloud. #### Limitations: - Only exterior videos may be uploaded. - Only 1 video file may be attached per drive (.mp4 or .mov format). - Video start and end times must correspond with the drive's start and end times. ### Method GET ### Endpoint `/gateway/v1/users/{user_id}/drives/{drive_id}/video-upload-url` ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user. - **drive_id** (string) - Required - The ID of the drive. #### Query Parameters - **start_timestamp** (integer) - Required - Milliseconds since Unix epoch (13 digits). - **end_timestamp** (integer) - Required - Milliseconds since Unix epoch (13 digits). - **extension** (string) - Required - Video extension type: 'mp4' or 'mov'. ### Request Example ```json { "example": "GET /gateway/v1/users/e4d8c777-5101-4206-88f4-f4fa32e8ad6b/drives/e4d8c777-5101-4206-88f4-f4fa32e8ad6b/video-upload-url?start_timestamp=1649207578000&end_timestamp=1649207578000&extension=mp4" } ``` ### Response #### Success Response (201) - **upload_url** (string) - The presigned URL for uploading the video. - **video_id** (string) - The unique identifier for the video. #### Response Example ```json { "upload_url": "https://your-s3-bucket.s3.amazonaws.com/videos/e4d8c777-5101-4206-88f4-f4fa32e8ad6b/video.mp4?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=999999999&Signature=bJ%2F2934875984759874598759874598759874598759874598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987598759875987 ``` -------------------------------- ### Get Drives Source: https://driver-gateway.readme.io/reference/get_drives-1 Query for a list of the latest drives, ordered by start date. Supports filtering by a Unix timestamp range and pagination. ```APIDOC ## GET /drives ### Description Query for a list of the latest drives (ordered by start_date_timestamp desc) based on filter criteria passed in the request. The drives API has a max limit on the number of drives that can be returned. As such, the client can pass in a unix timestamp range start_after and start_before. The client can then page through results by calling /drives and taking the last drive's start_date and using that as the value to pass in for start_before for the next API call to /drives. The "page.more" attribute in the response indicates whether more drives are available within the range provided. ### Method GET ### Endpoint /drives ### Parameters #### Query Parameters - **start_after** (integer) - Optional - A Unix timestamp indicating the start of the range to retrieve drives after. - **start_before** (integer) - Optional - A Unix timestamp indicating the end of the range to retrieve drives before. ### Response #### Success Response (200) - **page.more** (boolean) - Indicates if more drives are available within the specified range. - **drives** (array) - A list of drive objects. - **start_date_timestamp** (integer) - The timestamp when the drive started. #### Response Example ```json { "page": { "more": true }, "drives": [ { "start_date_timestamp": 1678886400 }, { "start_date_timestamp": 1678800000 } ] } ``` ``` -------------------------------- ### Remux and Trim Video using FFmpeg Source: https://driver-gateway.readme.io/reference/get_video_download_urls-1 An example command for advanced users to process HLS segments into a single MP4 file. It uses the offset and duration parameters to ensure precise timing during the remuxing process. ```bash ffmpeg -ss {offset} -i {concat:init.mp4|segment_n.m4s|segment_n+1.m4s} -t {duration} -f mp4 -c copy video.mp4 ``` -------------------------------- ### Filter Drives by Start Countries (Query Parameter) Source: https://driver-gateway.readme.io/reference/get_drives-1 Filters drive results by an array of start countries using the 'start_countries' query parameter. Each country code should be passed as an individual parameter (e.g., '?start_countries[]=US&start_countries[]=UA'). Note: The interactive playground may have issues with array formatting; ensure '[]' is appended to the key. ```json { "description": "Filter drives by an array of start countries (world country codes). Passed in as individual parameters.\n\ne.g. ?start_countries[]=USstart_countries[]=UA\n\n NOTE: The interactive playground for this field is currently out of service. For list queries the extra '[]' are missing, for example 'some_field=1&some_field=2', should be 'some_field[]=1&some_field[]=2'. However the endpoint itself works fine. Simply be sure to include [] to the end of the key for each variable in the array.\n\n", "example": [ "US", "UA" ], "in": "query", "name": "start_countries", "required": false, "schema": { "items": { "type": "string" }, "type": "array" } } ``` -------------------------------- ### GET /gateway/v1/users/{user_id}/drives/{drive_id}/accelerations Source: https://driver-gateway.readme.io/reference/get_accelerations-1 The `Get Accelerations` endpoint is used to retrieve a list containing all of the `accelerations` for a given drive. Accelerations are measured in units of g-force (9.8 m/s^2) and orientations are measured in radians/s. ```APIDOC ## GET /gateway/v1/users/{user_id}/drives/{drive_id}/accelerations ### Description Retrieves a list of accelerations for a specific drive. Accelerations are measured in g-force and orientations in radians/s. ### Method GET ### Endpoint /gateway/v1/users/{user_id}/drives/{drive_id}/accelerations ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user. - **drive_id** (string) - Required - The ID of the drive. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **ImuResponse** (object) - Contains the acceleration data. #### Response Example ```json { "accelerations": [ { "x": 0.1, "y": 0.2, "z": 9.8, "timestamp": "2023-01-01T12:00:00Z" } ], "orientations": [ { "x": 0.1, "y": 0.2, "z": 0.3, "timestamp": "2023-01-01T12:00:00Z" } ] } ``` #### Error Response (401) - **Unauthorized** (object) - Indicates that the request lacks valid authentication credentials. #### Error Response (404) - **NotFound** (object) - Indicates that the requested resource was not found. #### Error Response (422) - **UnprocessableEntity** (object) - Indicates that the request could not be processed due to semantic errors. ``` -------------------------------- ### GET /accelerations Source: https://driver-gateway.readme.io/reference/get_accelerations_v2-1 Retrieves a paginated list of acceleration events for a specific drive. ```APIDOC ## GET /accelerations ### Description Retrieves a list of acceleration events for a given drive. This endpoint supports cursor-based pagination to handle large datasets efficiently. ### Method GET ### Endpoint /accelerations ### Parameters #### Query Parameters - **drive_id** (string) - Required - The unique identifier of the drive. - **cursor** (string) - Optional - The cursor value used to retrieve the next page of results. - **batch_size** (integer) - Optional - The number of batches to fetch in a single request (max 15). ### Request Example GET /accelerations?drive_id=12345&batch_size=5 ### Response #### Success Response (200) - **accelerations** (array) - List of acceleration objects. - **page** (object) - Pagination metadata including start_cursor, end_cursor, next_cursor, total_count, and remaining_count. #### Response Example { "accelerations": [], "page": { "start_cursor": "abc", "end_cursor": "def", "next_cursor": "ghi", "total_count": 10, "remaining_count": 9 } } ``` -------------------------------- ### GET /accelerations/v2 Source: https://driver-gateway.readme.io/reference/get_accelerations_v2-1 Retrieves acceleration data (V2) for IMU monitoring. ```APIDOC ## GET /accelerations/v2 ### Description Retrieves the latest acceleration data points from the IMU sensor. ### Method GET ### Endpoint https://partners.api.drivertechnologies.io/accelerations/v2 ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example GET /accelerations/v2 ### Response #### Success Response (200) - **data** (AccelerationResponseV2) - The acceleration metrics object. #### Response Example { "acceleration": { "x": 0.05, "y": 0.02, "z": 9.81 }, "timestamp": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### GET /videos/presigned-url Source: https://driver-gateway.readme.io/reference/get_video_upload_url-1 Retrieves a presigned URL to facilitate secure video uploads to the platform. ```APIDOC ## GET /videos/presigned-url ### Description Retrieves a presigned URL that allows a client to upload a video file directly to the storage provider. ### Method GET ### Endpoint /videos/presigned-url ### Parameters #### Query Parameters - **filename** (string) - Required - The name of the file to be uploaded. ### Request Example GET /videos/presigned-url?filename=dashcam_recording.mp4 ### Response #### Success Response (200) - **url** (string) - The presigned URL for the upload request. - **fields** (object) - Required form fields for the upload request. #### Response Example { "url": "https://storage.provider.com/bucket", "fields": { "key": "uploads/video_123.mp4", "AWSAccessKeyId": "EXAMPLEKEY" } } ``` -------------------------------- ### GET /drives Source: https://driver-gateway.readme.io/reference/get_drives-1 Retrieve a list of drives filtered by various telematic, hardware, and environmental parameters. ```APIDOC ## GET /drives ### Description Retrieve filtered drive records based on telematic events, hardware device specifications, and video metadata. ### Method GET ### Endpoint /drives ### Parameters #### Query Parameters - **complex_filter** (string) - Optional - URI-encoded JSON string containing filters for object, lane, event, distance_bucket, and gforce_bucket. - **hardware_device** (string) - Optional - Filter drives recorded on a specific hardware device (e.g., iPhone). - **hardware_platform** (string) - Optional - Filter drives recorded on a specific hardware platform (e.g., iOS). - **app_version** (string) - Optional - Filter drives by app version using semver format. - **include_detected_objects** (boolean) - Optional - Include detected objects in the response. - **orientation** (string) - Optional - Filter by video orientation ('landscape' or 'portrait'). - **camera_alignment** (number) - Optional - Filter by camera alignment score (1-100). - **period[]** (array) - Optional - Filter by period ('daytime', 'nighttime', 'mixed'). Append [] to the key. ### Request Example GET /drives?complex_filter=%7B%22object%22%3A%20%22MOTORCYCLE%22%7D&hardware_device=iPhone ### Response #### Success Response (200) - **drives** (array) - List of drive objects matching the criteria. #### Response Example { "drives": [ { "id": "drive_123", "hardware_device": "iPhone", "status": "completed" } ] } ``` -------------------------------- ### GET /orientations (V2) Source: https://driver-gateway.readme.io/reference/get_orientations_v2-1 Retrieves orientation data (V2) for the specified driver or device context. ```APIDOC ## GET /orientations ### Description Retrieves the latest orientation data (V2) for the authenticated user or device. ### Method GET ### Endpoint https://partners.api.drivertechnologies.io/orientations ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example GET /orientations ### Response #### Success Response (200) - **data** (OrientationResponseV2) - The orientation data object. #### Response Example { "orientation": "landscape", "timestamp": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### POST /gateway/v1/users/{user_id}/drives/{drive_id}/orientations Source: https://driver-gateway.readme.io/reference/create_orientations-1 The `Create Orientations` endpoint is used to create 1 or more `orientations` for a given drive. Currently, the maximum number of `orientations` that can be uploaded in a single request is `1500`. If your drive contains more than `1500` `orientations`, you can split the `orientations` into multiple requests. Authentication requires an API key and a valid authorization token. ```APIDOC ## POST /gateway/v1/users/{user_id}/drives/{drive_id}/orientations ### Description Creates 1 or more `orientations` for a given drive. The maximum number of `orientations` per request is 1500. For more, split into multiple requests. ### Method POST ### Endpoint /gateway/v1/users/{user_id}/drives/{drive_id}/orientations ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user. - **drive_id** (string) - Required - The ID of the drive. #### Query Parameters None #### Request Body - **orientations** (array) - Required - An array of orientation objects. - **timestamp** (integer) - Required - The Unix timestamp in milliseconds. - **x** (number) - Required - The x-axis acceleration. - **y** (number) - Required - The y-axis acceleration. - **z** (number) - Required - The z-axis acceleration. - **roll** (number) - Required - The roll angle in degrees. - **pitch** (number) - Required - The pitch angle in degrees. - **yaw** (number) - Required - The yaw angle in degrees. ### Request Example ```json { "orientations": [ { "timestamp": 1678886400000, "x": 0.1, "y": 0.2, "z": 9.8, "roll": 10.5, "pitch": -5.2, "yaw": 0.0 } ] } ``` ### Response #### Success Response (201) - **message** (string) - A success message indicating the orientations were created. #### Response Example ```json { "message": "Orientations created successfully." } ``` #### Error Responses - **401 Unauthorized**: Returned if the API key or authorization token is invalid. - **422 Unprocessable Entity**: Returned if the request body is invalid or contains invalid data. ``` -------------------------------- ### Filter Drives by Start Areas (Query Parameter) Source: https://driver-gateway.readme.io/reference/get_drives-1 Filters drive results by an array of start areas, typically US states, using the 'start_areas' query parameter. Each state should be passed as an individual parameter (e.g., '?start_areas[]=MN&start_areas[]=RI'). Note: The interactive playground may have issues with array formatting; ensure '[]' is appended to the key. ```json { "description": "Filter drives by an array of start areas (states in the US). Passed in as individual parameters.\n\ne.g. ?start_areas[]=MN&start_areas[]=RI\n\n NOTE: The interactive playground for this field is currently out of service. For list queries the extra '[]' are missing, for example 'some_field=1&some_field=2', should be 'some_field[]=1&some_field[]=2'. However the endpoint itself works fine. Simply be sure to include [] to the end of the key for each variable in the array.\n\n", "example": [ "CT", "NY" ], "in": "query", "name": "start_areas", "required": false, "schema": { "items": { "type": "string" }, "type": "array" } } ``` -------------------------------- ### POST /drives Source: https://driver-gateway.readme.io/reference/create_drive-1 Creates a new drive with the provided parameters. If an `id` is not specified, a UUID will be automatically generated. ```APIDOC ## POST /drives ### Description Creates a new drive with the provided parameters. If an `id` is not specified, a UUID will be automatically generated. ### Method POST ### Endpoint /drives ### Parameters #### Request Body - **app_version** (string) - Optional - The app version running on the device that created the drive. (6.2.5) - **hardware_device** (string) - Optional - The model of the physical device that captured the drive. (iPhone 11, Pixel 3, k245c) - **hardware_platform** (string) - Optional - The platform/os of the device the drive was created on. (iOS, Android, Android Auto) - **id** (string) - Optional - Your organization has the ability to determine what `id` they'd like to associate with each `drive`. This can be useful if a `drive` already exists in your system and you'd like to use the same `id` to associate it to the one in our system. If no value is passed, Driver will automatically generate a `UUID` for the `drive` and return that back in the response. - **os_version** (string) - Optional - The os version of the hardware device that created the drive. - **start_date_timestamp** (string) - Required - The date and time the drive started in ISO8601. - **start_lat** (number) - Required - Start latitude for the drive. - **start_long** (number) - Required - Start longitude for the drive. ### Request Example ```json { "app_version": "1.0.0", "hardware_device": "iPhone 11", "hardware_platform": "iOS", "id": "101b30d5-a7d0-4bcc-abd1-bd4e4e1e3037", "os_version": "1.0.0", "start_date_timestamp": "2022-11-10T19:49:28.434995Z", "start_lat": 40.7187485, "start_long": -73.9921583 } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the created drive. - **status** (string) - The current status of the drive. #### Response Example ```json { "id": "101b30d5-a7d0-4bcc-abd1-bd4e4e1e3037", "status": "processing" } ``` ``` -------------------------------- ### POST /gateway/v1/users/{user_id}/drives/{drive_id}/accelerations Source: https://driver-gateway.readme.io/reference/create_accelerations-1 The `Create Accelerations` endpoint is used to create 1 or more `accelerations` for a given drive. Currently, the maximum number of `accelerations` that can be uploaded in a single request is `1500`. Authentication requires an API key and a valid authorization token. ```APIDOC ## POST /gateway/v1/users/{user_id}/drives/{drive_id}/accelerations ### Description Creates one or more accelerations for a given drive. The maximum number of accelerations per request is 1500. Authentication is required using an API key and an authorization token. ### Method POST ### Endpoint /gateway/v1/users/{user_id}/drives/{drive_id}/accelerations ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user. - **drive_id** (string) - Required - The ID of the drive. #### Query Parameters None #### Request Body - **accelerations** (array) - Required - An array of acceleration objects. - **x** (number) - Required - Acceleration value on the x-axis. - **y** (number) - Required - Acceleration value on the y-axis. - **z** (number) - Required - Acceleration value on the z-axis. - **timestamp** (string) - Required - ISO 8601 timestamp of the acceleration measurement. ### Request Example ```json { "accelerations": [ { "x": 0.1, "y": -0.2, "z": 9.8, "timestamp": "2023-10-27T10:00:00Z" }, { "x": 0.15, "y": -0.25, "z": 9.75, "timestamp": "2023-10-27T10:00:01Z" } ] } ``` ### Response #### Success Response (201) - **message** (string) - A success message indicating the accelerations were created. #### Response Example ```json { "message": "Accelerations created successfully." } ``` #### Error Responses - **401 Unauthorized**: If the authentication token is invalid or missing. - **422 Unprocessable Entity**: If the request body is invalid or contains incorrect data types. ``` -------------------------------- ### GET /gateway/v1/users/{user_id}/drives/{drive_id}/video-download-urls Source: https://driver-gateway.readme.io/reference/get_video_download_urls-1 Retrieves the video download URLs for a specific drive associated with a user. ```APIDOC ## GET /gateway/v1/users/{user_id}/drives/{drive_id}/video-download-urls ### Description Retrieves the secure download URLs for video files associated with a specific drive session. ### Method GET ### Endpoint /gateway/v1/users/{user_id}/drives/{drive_id}/video-download-urls ### Parameters #### Path Parameters - **user_id** (string) - Required - The unique identifier of the user. - **drive_id** (string) - Required - The unique identifier of the drive. ### Request Example GET /gateway/v1/users/123/drives/abc/video-download-urls ### Response #### Success Response (200) - **urls** (array) - A list of signed URLs for video downloads. #### Response Example { "urls": [ "https://storage.example.com/video1.mp4?token=xyz" ] } ``` -------------------------------- ### POST /users Source: https://driver-gateway.readme.io/reference/create_user-1 Creates a new user in the system. Requires authentication via API key or authorization header. ```APIDOC ## POST /users ### Description Creates a new user record within the Driver Gateway system. ### Method POST ### Endpoint https://partners.api.drivertechnologies.io/users ### Parameters #### Request Body - **UserCreateParams** (object) - Optional - The user creation parameters schema. ### Request Example { "username": "johndoe", "email": "john@example.com" } ### Response #### Success Response (201) - **UserResponse** (object) - The created user object. #### Response Example { "id": "user_123", "status": "created" } ### Error Handling - **401**: Unauthorized - Authentication failed. - **404**: Not Found - The requested resource does not exist. - **422**: Unprocessable Entity - Validation errors in the request body. ``` -------------------------------- ### GET /videos/download Source: https://driver-gateway.readme.io/reference/get_video_download_urls-1 Retrieves a list of presigned download URLs for video files. These URLs are temporary and expire after a set period. ```APIDOC ## GET /videos/download ### Description Retrieves a list of one or more presigned download URLs for video files. These URLs have an expiration date and provide secure access to the underlying storage. ### Method GET ### Endpoint /videos/download ### Parameters #### Query Parameters - **drive_id** (string) - Required - The unique identifier for the drive. - **clip_start** (number) - Optional - Start time in seconds for a clipped segment. - **clip_duration** (number) - Optional - Duration in seconds for a clipped segment. ### Response #### Success Response (200) - **data** (object) - Container for the response data. - **duration** (number) - Exact clip duration in seconds. - **offset** (number) - Offset in seconds inside the first returned segment where the clip begins. - **signed_download_urls** (array) - List of objects containing file names and their corresponding signed URLs. #### Response Example { "data": { "duration": 3, "offset": 2, "signed_download_urls": [ { "file_name": "your-video.mp4", "url": "https://exampleurl.s3.us-east-2.amazonaws.com/your-video.mp4?X-Amz-Expires=1800&..." } ] } } ``` -------------------------------- ### POST /auth/signin Source: https://driver-gateway.readme.io/reference/sign_in-1 Authenticates a user with provided credentials and returns an access token upon success. ```APIDOC ## POST /auth/signin ### Description Authenticates the user using provided credentials and returns an access token for subsequent API requests. ### Method POST ### Endpoint https://partners.api.drivertechnologies.io/auth/signin ### Request Body - **SignInParams** (object) - Required - The credentials required for authentication. ### Request Example { "email": "user@example.com", "password": "securepassword" } ### Response #### Success Response (201) - **access_token** (string) - The JWT access token for authorized requests. #### Error Response (401) - **error** (string) - Message indicating that the provided credentials are invalid. #### Response Example { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` -------------------------------- ### GET /gateway/v1/organizations/{organization_id}/heartbeats Source: https://driver-gateway.readme.io/reference/get_organization_heartbeats-1 The `Get Organization Heartbeats` endpoint is used to fetch the latest locations for members in your organization. Authentication requires an API key and a valid authorization token. ```APIDOC ## GET /gateway/v1/organizations/{organization_id}/heartbeats ### Description Fetches the latest locations for members within a specified organization. ### Method GET ### Endpoint `/gateway/v1/organizations/{organization_id}/heartbeats` ### Parameters #### Path Parameters - **organization_id** (string) - Required - The unique identifier for the organization. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **heartbeats** (array) - A list of heartbeat objects, each containing location data for organization members. #### Response Example ```json { "heartbeats": [ { "member_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "latitude": 34.0522, "longitude": -118.2437, "timestamp": "2023-10-27T10:00:00Z" } ] } ``` #### Error Responses - **401 Unauthorized**: Returned if the API key or authorization token is invalid. - **404 Not Found**: Returned if the specified organization ID does not exist. - **422 Unprocessable Entity**: Returned if the request parameters are invalid. ``` -------------------------------- ### GET /websites/driver-gateway_readme_io_reference/videos/{user_id}/{drive_id} Source: https://driver-gateway.readme.io/reference/get_video_download_urls-1 The `Get Video Download Urls` endpoint is used to generate presigned video download URLs to download videos associated with a drive. This will return the video in its original format, which can include HLS or MP4/MOV. By default all HLS segments will be returned unless `start_timestamp` and/or `end_timestamp` parameters are passed. ```APIDOC ## GET /websites/driver-gateway_readme_io_reference/videos/{user_id}/{drive_id} ### Description Generates presigned video download URLs for a given drive. Supports filtering by timestamp range for HLS segments. ### Method GET ### Endpoint `/websites/driver-gateway_readme_io_reference/videos/{user_id}/{drive_id}` ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user. - **drive_id** (string) - Required - The ID of the drive. #### Query Parameters - **start_timestamp** (integer) - Optional - Milliseconds since unix epoch (13 digits). Filters segments from this timestamp. - **end_timestamp** (integer) - Optional - Milliseconds since unix epoch (13 digits). Filters segments up to this timestamp. ### Request Example ```json { "example": "GET /websites/driver-gateway_readme_io_reference/videos/e4d8c777-5101-4206-88f4-f4fa32e8ad6b/e4d8c777-5101-4206-88f4-f4fa32e8ad6b?start_timestamp=1649207578000&end_timestamp=1649207578000" } ``` ### Response #### Success Response (200) - **urls** (array) - An array of presigned download URLs for the video segments. - **offset** (integer) - The offset in milliseconds for precise timestamp clamping. - **duration** (integer) - The duration of the video in milliseconds. #### Response Example ```json { "example": { "urls": [ "https://example.com/signed-url-1", "https://example.com/signed-url-2" ], "offset": 1000, "duration": 60000 } } ``` ```