DVIR Forms V3

The DVIR Forms V3 API is used to handle queries for creation and editing DVIR forms similar to that of the DVIR Forms API. The difference between the V3 and the V2 APIs is that the V3 API accepts and returns only inspection points that either marked as failed, have a comment, or have an image attached to it. Inspections that all items marked as passed and do not have comments or images will still appear in this API but will have an empty “points” array in their DVIR Area. A “templateId” field is required to construct the complete form with both PASSED and FAILED inspection points.

DVIR Form Inspections are automatically deleted after a specific period of time following the data retention policy.

Fields

Tag Data Type Required Description
accountId Long Auto The id of the Account that owns this record.
areas Array No The areas of the DVIR Form
description Text (unlimited) No A description of the DVIR Form
dvirId Long No The ID of the DVIR where this inspection belonged to. Value is 0 if the inspection has not yet been included in a DVIR record.
endTime * Text No Timestamp when the inspection ended 
Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z)
equipmentCondition *     Condition of the Equipment according to the DVIR. Can either be:

  • DEFECTS_CORRECTED
  • UNSATISFACTORY
  • SATISFACTORY
  • NO_DEFECT_FOUND
equipmentId Long No Id of the Equipment associated with the DVIR record
id Auto-incremented Long Auto Unique identifier 
inspectionType * inspection_trip_type No Information on the type of inspection. Can either be: 

  • POST_TRIP
  • PRE_TRIP
  • AD_HOC
inspectorType * inspector_type No Information on the type of inspector. Can either be: 

  • DRIVER
  • MECHANIC
isTemplate Boolean No Indicates if the record is a DVIR form (true) or an inspection (false)
location * Character (255) No The address where the DVIR was performed.
media Array No  Image associated with the DVIR Form, usually a picture of Equipment
name Character (255) Yes The name of the DVIR Form
odometerKm* Double Precision No The odometer value on the time of the DVIR. Value is 0.0 if the inspection has not yet been included in a DVIR record.
startTime * Text No Timestamp when the inspection started
Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z)
status * inspection_status No The status of the inspection
templateId Long Yes The id of the DVIR Form template used for this inspection
terminalId * Long No The id of the Home Terminal of the User who performed the DVIR
userId Long No The id of the user who performed the DVIR
* this field is taken from the DVIR record that this DVIR Form is associated to. This field is only returned on the GET method if inspection has been included in the DVIR already and cannot be used in the POST and PUT method.
 

Read DVIR Forms

Read Inspections

** additional fields marked with * from the table are also included in the response if inspection has been included in the DVIR already. 

Create DVIR Forms

Create Inspections

Update DVIR Forms

Update Inspections

Delete

API PATH: /api/v3/dvirForms/<id>
METHOD: DELETE

API error calls

ERROR MESSAGE POSSIBLE CAUSES
Area: <AreaName> has two or more points with duplicate names, this is not allowed POST error because DVIR Form has inspection points with the same name within the specified area
Inspection points should have severity POST or PUT error because DVIR Form templates need to a have a default severity for each DVIR Point.
DVIR Form with ID <id> does not exist. PUT error because DVIR Form id does not exist.