Fleet - Safety

Safety report

A safety report is an overview of safety driving and events.

This API can get event and trip summaries and the trend type of 4 types of events:

  • Sensor Event
  • AI(ADAS) Event
  • Traffic sign
  • AI(DMS) Event
Securityapi key and Authorization
Request
query Parameters
since
required
integer <int32>

Query items after the timestamp(Unix timestamp)

until
required
integer <int32>

Query items before the timestamp(Unix timestamp)

tz
string

When grouping information by date, you may prefer not to use the UTC+0 time zone. Using the 'tz' parameter allows for grouping dates based on the specified time zone.

Responses
200

OK

get/V2/analytics/safety
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "summary": {
    },
  • "trend": [
    ]
}

Event list

This API is used to get and query event list within time period.

Securityapi key and Authorization
Request
query Parameters
sort
string

The field to sort

available fields are:

time

Example: sort=time
keyword
string

Query the trip with keywords, which apply with driver name or asset id

type
string

The types to querying with, and should separate with a comma

Example: type=1,4,22
device_cids
string

To query with specific CIDs. Comma separate.

ex: 96732f17-b4d1-4b67-97de-3fae29237057,21a8e7c5-c034-4e59-b234-21352b1a92df

order
string (Order)

Enum of order

ASC

DESC

Enum: "ASC" "DESC"
offset
integer <int32>
Default: 0

For pagination offset

limit
integer <int32>
Default: 5

For pagination limit

since
required
integer <int32>

Query items after the timestamp(Unix timestamp)

until
required
integer <int32>

Query items before the timestamp(Unix timestamp)

serial_number
string

Query items by the serial number.

Responses
200

OK

get/V2/events
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "count": 0,
  • "data": [
    ]
}

Event detail

This API is used to get the detail information of event

Securityapi key and Authorization
Request
query Parameters
ticket
required
string
Responses
200

OK

get/V2/event/detailV2
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "data": [
    ]
}

Video asset details

This API is used to get the video asset details information of event

Securityapi key and Authorization
Request
Request Body schema: multipart/form-data
ticket
required
string
Responses
200

OK

post/V2/event/GetVideoDetail
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "data": {
    }
}

List of manual upload

This API is used to get event videos that upload manually.

The list contains:

device CID, event name, event expiration status, left days to expired, latitude and longitude of the event, device, event recording video ID, tag info, trip ID

task state

value state description
0 Upcoming The server sends a command to the device.
1 Processing After receiving the command, the device notifies the server.
2 Success Upload progress is tracked by the server. All files have been received successfully.
3 Failed The device reports an error message.
4 Clipping file The server receives the number of clips that can be processed and their status from the device.
5 Uploading file Once the device is ready to upload, it requests a ticket. After getting the ticket, it starts uploading the videos. The server counts the uploaded files.
6 Partial Success Task partially completed(e.g., only some clips uploaded)

camera codes

code description
D_E20001 Video is not existing
D_E20002 Videos merges fail
D_E20003 Clip process is busy
D_E20004 Device is busy on uploading events (when command is made through P2P, legacy)
D_E20005 Failed to get ticket from server (when command is made through P2P, legac)
D_E20006 2nd SDCard is unmounted (when command is made through P2P, legacy)
D_E20007 The task is finished but failed
D_E20009 Insufficient internal flash storage space
D_E20010 Upload time expired (The task is queued for over three days, and removed by the camera app)

last_ack_message (process_history)

field type description
code string or null camera code, e.g., D_S00000 indicates success.
desc string or null description. May be null.
state string or null camera status, such as video processing.
report_at integer (Unix timestamp) or null Timestamp of the server current task report.
state_desc string or null Task progress status (e.g., (2/3) means stage 2 of 3). May be null.
progress_status array or [] (empty array) A list of camera-specific task progress entries.

progress_status

field type description
camId string or null Camera identifier(e.g., C_E, S_F_I).
state string or null Current status of this camera task (e.g., Uploading, Success).
report_at integer or null Timestamp of this camera's progress update.
state_number integer or null Numeric stage of the task (e.g., 6 = step 6).

state_number

value state description
0 Preparing to clip The camera is waiting to start clipping.
1 Starting clipping The camera has started clipping the video.
2 Clipping successful The camera finished clipping successfully.
3 Clipping failed The camera failed to clip the video.
4 Video not found The camera cannot find the video file.
5 Preparing to upload The camera is ready to upload the video.
6 Uploading success The camera uploaded the video successfully.
7 Upload time expired The camera took too long; upload expired.

Indicates whether to filter for timelapse videos.

  • true: includes timelapse videos
  • false: only normal videos Note: If type = 27,27 and timelapse = true, both normal and timelapse videos will be queried.
Securityapi key and Authorization
Request
query Parameters
sort
string

The field to sort

available fields are:

uploadDate

Example: sort=uploadDate
keyword
string

Query with keywords, which apply with file name or asset id or vehicle name or driver name

type
string

The types to querying with, and should seprate with a comma

Example: type=27,28,29
task_state_filter
string

The task_state_filter to querying with, and should seprate with a comma

Example: task_state_filter=0,1,2,3,4,5,6
time_lapse
boolean

Set to true to filter for timelapse videos; false for normal videos.

Example: time_lapse=true
order
string (Order)

Enum of order

ASC

DESC

Enum: "ASC" "DESC"
offset
integer <int32>
Default: 0

For pagination offset

limit
integer <int32>
Default: 5

For pagination limit

since
required
integer <int32>

Query items after the timestamp(Unix timestamp)

until
required
integer <int32>

Query items before the timestamp(Unix timestamp)

serial_number
string

Query items by the serial number.

Responses
200

OK

get/V2/event/StorageList
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "count": 0,
  • "data": [
    ]
}

Request video clip

This API can send a remote command to request the device to upload a video clip asynchronously, regardless of whether the device is online or not when the request is made.
The response includes a task ID that allows you to check the result with V2/event/taskResult/{taskId} later.

This feature was introduced from region 43.
The device won't respond to the remote command before the version of region 43.

Securityapi key and Authorization
Request
path Parameters
sn
required
string

serial number or cid(certificate id)

Request Body schema:
required
cam_id
required
string non-empty

The cameria id, please refer to Camera capture mode and Camera ID

Additionally, you can set cam_id to 'ALL' to upload all video clips corresponding to the target_timestamp parameter.

Upload all video clips at once requires Cam app version 1.2.21.3-REL_20240701_1455 or higher.

Upload all video clips at once requires region R44 or higher.

file_name
required
string non-empty

The desired file name to save as.
It will reject file names that contain the following characters:
../, ", ', &, /, \, ?, #, :

target_timestamp
required
integer <int32>

The desired timestamp to include in the video clip

single_event
boolean
Default: true

A flag to control the multiple video files will be uploaded along with the same event.

duration_in_seconds
integer or null <int32> [ 1 .. 86400 ]
Default: 30

Duration of the video
duration_in_seconds will be processed into an even number, then evenly divided into two parts centered around target_timestamp.

Responses
200

OK

post/V2/event/videoClip/{sn}
Request samples
{
  • "cam_id": "string",
  • "file_name": "string",
  • "target_timestamp": 0,
  • "single_event": true,
  • "duration_in_seconds": 30
}
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "data": {
    }
}

Get task process history

This API allowing you to query the process result of a remote task like

  1. request to upload a video clip
Securityapi key and Authorization
Request
path Parameters
taskId
required
string
Responses
200

OK

get/V2/event/taskResult/{taskId}
Response samples
application/json
{
  • "uq": "3903dc78-9349-41a0-9662-d1e33de117f8",
  • "doc_version": "latest",
  • "result": true,
  • "code": "S00000",
  • "message": "string",
  • "build": "string",
  • "data": {
    }
}

To discard an event

This API can discard an event.

Deleting the event will not update the score for that specific trip; instead, it will be reflected in the driver's overall driving score as a positive adjustment.
Please note that this action is irreversible.

Securityapi key and Authorization
Request
Request Body schema: multipart/form-data
ticket
required
string
Responses
200

OK

post/V2/event/discard