Step 4: View Driver and Vehicle Inspection Reports
An Inspection Report represents a vehicle's daily inspection report. Inspection report record is tied to both vehicle and driver. Each inspection report can contain multiple trailer and tractor defects. Based on the defects and type of entity you can create work orders at your end and assign them to a service representative.
This step involves the following two sub-steps:
4A: Fetch a list of the company vehicle's inspection reports
Responses for this endpoint are based on the options you enable for the inspection reports feature on your Motive dashboard mainly the Custom Defect List and the Defect Level Resolution.
- Custom Defect List: If this option is enabled for inspection reports, then you will receive the response in the following hierarchy.
- Inspected parts
- Defects object
- Inspected parts
The defects object will be embedded inside every inspected parts array. The Defects object will contain information about the defect such as the name (title),and the severity (major or minor).
- Defect Level Resolution: If this option is enabled for inspection reports, then you will receive the response in the following hierarchy.
- Inspected parts
- Mechanic Details
- Resolver
- Mechanic Details
- Inspected parts
The mechanic details object contains the mechanic_signature_url
and the mechanic_signed_at
parameters with values as null
. These values are present inside every inspected_part
. The status of these parts can be one of the following:
good
open
repaired
no_repair_needed
The mechanic details are present inside the resolver object.
For defect level resolution, the external_resolver_id, serves as a unique identifier for the resolver of your system. This ID will be sent back to Motive in the public API, but will not be visible on the dashboard.
The responses will be as follows:
{
"inspection_reports": [
{
"inspection_report": {
"id": 9,
"log_id": 1,
"date": "2016-07-22",
"time": "2016-07-22T14:00:00Z",
"odometer": 253,
"carrier_name": "Demo Carrier",
"location": "Omaha, NE",
"status": "corrected",
"mechanic_signed_at": "2016-07-22T14:00:00Z",
"mechanic_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/mechanic_signature_upload/9/open-uri20160712-30633-thc30n?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"driver_signed_at": "2016-07-22T14:00:00Z",
"driver_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/driver_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"reviewer_signed_at": "2016-07-22T14:00:00Z",
"reviewer_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/reviewer_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"entity_num": "entity_num",
"entity_type": "vehicle",
"is_rejected": false,
"inspection_type": "pre-trip",
"declaration": "I declare that this vehicle has been inspected in accordance with the applicable requirements.",
"inspected_parts": [
{
"id": 5,
"category": "Brakes",
"notes": "notes",
"type": "major",
"picture_url": "https://keep-truckin-preview.s3.amazonaws.com/uploads/defect/picture_upload/23137/15c31555-6642-4215-a3cd-81def1d329012396939324379336808.jpg?X"
}
],
"not_inspected_parts": [
{
"category": "9 - Emergency Equipment & Safety Devices"
},
{
"category": "15 - Heater/Defroster"
}
],
"vehicle": {
"id": 4,
"number": "Demo Vehicle",
"year": "2016",
"make": "Demo",
"model": "Vehicle",
"vin": "WP0AB2966NS458669",
"metric_units": false
},
"asset": {
"id": 101,
"make": "Toyota",
"metric_units": true,
"model": "Camry",
"name": "V123",
"year": 2022
},
"mechanic": {
"id": 12,
"first_name": "Joe",
"last_name": "Williams",
"username": null,
"email": "joe@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"driver": {
"id": 11,
"first_name": "Demo",
"last_name": "Driver",
"username": "demo_driver",
"email": null,
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"reviewer": {
"id": 13,
"first_name": "John",
"last_name": "Williams",
"username": null,
"email": "john@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"external_ids": [
{
"external_id": "201",
"integration_name": "generic_tms"
},
{
"external_id": "Truck123",
"integration_name": "generic_maintenance_system"
}
],
"entries": [
{
"name": "Tractor Plate #",
"value": "2743186",
"position": 1
},
{
"name": "Trailer Plate #",
"value": "T473278",
"position": 2
}
]
}
}
],
"per_page": 25,
"page_no": 1,
"total": 3
}
{
"inspection_reports": [
{
"inspection_report": {
"id": 9,
"log_id": 1,
"date": "2016-07-22",
"time": "2016-07-22T14:00:00Z",
"odometer": 253,
"carrier_name": "Demo Carrier",
"location": "Omaha, NE",
"status": "corrected",
"mechanic_signed_at": "2016-07-22T14:00:00Z",
"mechanic_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/mechanic_signature_upload/9/open-uri20160712-30633-thc30n?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"driver_signed_at": "2016-07-22T14:00:00Z",
"driver_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/driver_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"reviewer_signed_at": "2016-07-22T14:00:00Z",
"reviewer_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/reviewer_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"entity_num": "entity_num",
"entity_type": "vehicle",
"is_rejected": false,
"inspection_type": "pre-trip",
"declaration": "I declare that this vehicle has been inspected in accordance with the applicable requirements.",
"inspected_parts": [
{
"id": 5,
"category": "Brakes",
"notes": "notes",
"type": "major",
"picture_url": "https://keep-truckin-preview.s3.amazonaws.com/uploads/defect/picture_upload/23137/15c31555-6642-4215-a3cd-81def1d329012396939324379336808.jpg",
"defects": [
{
"title": "Air pressure gauge failure",
"severity": "major"
},
{
"title": "Slow air pressure build up rate",
"severity": "major"
},
{
"title": "Air loss rate exceeds prescribed limit",
"severity": "minor"
}
]
}
],
"not_inspected_parts": [
{
"category": "9 - Emergency Equipment & Safety Devices"
},
{
"category": "15 - Heater/Defroster"
}
],
"vehicle": {
"id": 4,
"number": "Demo Vehicle",
"year": "2016",
"make": "Demo",
"model": "Vehicle",
"vin": "WP0AB2966NS458669",
"metric_units": false
},
"asset": {
"id": 101,
"make": "Toyota",
"metric_units": true,
"model": "Camry",
"name": "V123",
"year": 2022
},
"mechanic": {
"id": 12,
"first_name": "Joe",
"last_name": "Williams",
"username": null,
"email": "joe@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"driver": {
"id": 11,
"first_name": "Demo",
"last_name": "Driver",
"username": "demo_driver",
"email": null,
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"reviewer": {
"id": 13,
"first_name": "John",
"last_name": "Williams",
"username": null,
"email": "john@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"external_ids": [
{
"external_id": "201",
"integration_name": "generic_tms"
},
{
"external_id": "Truck123",
"integration_name": "generic_maintenance_system"
}
],
"entries": [
{
"name": "Tractor Plate #",
"value": "2743186",
"position": 1
},
{
"name": "Trailer Plate #",
"value": "T473278",
"position": 2
}
]
}
}
],
"per_page": 25,
"page_no": 1,
"total": 3
}
{
"inspection_reports": [
{
"inspection_report": {
"id": 9,
"log_id": 1,
"date": "2016-07-22",
"time": "2016-07-22T14:00:00Z",
"odometer": 253,
"carrier_name": "Demo Carrier",
"location": "Omaha, NE",
"status": "resolved",
"mechanic_signed_at": null,
"mechanic_signature_url": null,
"driver_signed_at": "2016-07-22T14:00:00Z",
"driver_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/driver_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"reviewer_signed_at": "2016-07-22T14:00:00Z",
"reviewer_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/reviewer_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"entity_num": "entity_num",
"entity_type": "vehicle",
"is_rejected": false,
"inspection_type": "pre-trip",
"declaration": "I declare that this vehicle has been inspected in accordance with the applicable requirements.",
"inspected_parts": [
{
"id": 5,
"category": "Brakes",
"notes": "notes",
"type": "major",
"picture_url": "https://keep-truckin-preview.s3.amazonaws.com/uploads/defect/picture_upload/23137/15c31555-6642-4215-a3cd-81def1d329012396939324379336808.jpg?X",
"status": "[open]/[repaired]/[no_repair_needed]/[good]",
"mechanic_details": {
"resolver": {
"id": 1005,
"first_name": "Joshua",
"last_name": "Lee",
"username": "Joshua Lee",
"email": "joshua@democarrier.com",
"driver_company_id": "123",
"status": "active",
"role": "driver"
},
"external_resolver_id": "111",
"mechanic_name": "Joshua Lee",
"mechanic_signed_at": "2016-07-22T14:00:00Z",
"mechanic_note": "this is resolved person note, could be anything",
"mechanic_signature": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/mechanic_signature_upload/9/open-uri20160712-30633-thc30n?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D"
}
}
],
"not_inspected_parts": [
{
"category": "9 - Emergency Equipment & Safety Devices"
},
{
"category": "15 - Heater/Defroster"
}
],
"vehicle": {
"id": 4,
"number": "Demo Vehicle",
"year": "2016",
"make": "Demo",
"model": "Vehicle",
"vin": "WP0AB2966NS458669",
"metric_units": false
},
"asset": {
"id": 101,
"make": "Toyota",
"metric_units": true,
"model": "Camry",
"name": "V123",
"year": 2022
},
"mechanic": {
"id": 12,
"first_name": "Joe",
"last_name": "Williams",
"username": null,
"email": "joe@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"driver": {
"id": 11,
"first_name": "Demo",
"last_name": "Driver",
"username": "demo_driver",
"email": null,
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"reviewer": {
"id": 13,
"first_name": "John",
"last_name": "Williams",
"username": null,
"email": "john@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"external_ids": [
{
"external_id": "201",
"integration_name": "generic_tms"
},
{
"external_id": "Truck123",
"integration_name": "generic_maintenance_system"
}
],
"entries": [
{
"name": "Tractor Plate #",
"value": "2743186",
"position": 1
},
{
"name": "Trailer Plate #",
"value": "T473278",
"position": 2
}
]
}
}
],
"per_page": 25,
"page_no": 1,
"total": 3
} "position": 1
},
{
"name": "Trailer Plate #",
"value": "T473278",
"position": 2
}
]
}
}
],
"per_page": 25,
"page_no": 1,
"total": 3
}
{
"inspection_reports": [
{
"inspection_report": {
"id": 9,
"log_id": 1,
"date": "2016-07-22",
"time": "2016-07-22T14:00:00Z",
"odometer": 253,
"carrier_name": "Demo Carrier",
"location": "Omaha, NE",
"status": "resolved",
"mechanic_signed_at": null,
"mechanic_signature_url": null,
"driver_signed_at": "2016-07-22T14:00:00Z",
"driver_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/driver_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"reviewer_signed_at": "2016-07-22T14:00:00Z",
"reviewer_signature_url": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/reviewer_signature_upload/9/open-uri20160729-30645-1jeoj77?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D",
"entity_num": "entity_num",
"entity_type": "vehicle",
"is_rejected": false,
"inspection_type": "pre-trip",
"declaration": "I declare that this vehicle has been inspected in accordance with the applicable requirements.",
"inspected_parts": [
{
"id": 5,
"category": "Brakes",
"notes": "notes",
"type": "major",
"picture_url": "https://keep-truckin-preview.s3.amazonaws.com/uploads/defect/picture_upload/23137/15c31555-6642-4215-a3cd-81def1d329012396939324379336808.jpg?X",
"status": "[open]/[repaired]/[no_repair_needed]/[good]",
"mechanic_details": {
"resolver": {
"id": 1005,
"first_name": "Joshua",
"last_name": "Lee",
"username": "Joshua Lee",
"email": "joshua@democarrier.com",
"driver_company_id": "123",
"status": "active",
"role": "driver"
},
"external_resolver_id": "111",
"mechanic_name": "Joshua Lee",
"mechanic_signed_at": "2016-07-22T14:00:00Z",
"mechanic_note": "this is resolved person note, could be anything",
"mechanic_signature": "https://keep-truckin-development.s3.amazonaws.com/uploads/inspection_report/mechanic_signature_upload/9/open-uri20160712-30633-thc30n?AWSAccessKeyId=AKIAJH12345&Expires=1481274629&Signature=Qi1mXnl0ylJ5tCuds789Ocq44L4%3D"
},
"defects": [
{
"title": "Air pressure gauge failure",
"severity": "major"
},
{
"title": "Slow air pressure build up rate",
"severity": "major"
},
{
"title": "Air loss rate exceeds prescribed limit",
"severity": "minor"
}
]
}
],
"not_inspected_parts": [
{
"category": "9 - Emergency Equipment & Safety Devices"
},
{
"category": "15 - Heater/Defroster"
}
],
"vehicle": {
"id": 4,
"number": "Demo Vehicle",
"year": "2016",
"make": "Demo",
"model": "Vehicle",
"vin": "WP0AB2966NS458669",
"metric_units": false
},
"asset": {
"id": 101,
"make": "Toyota",
"metric_units": true,
"model": "Camry",
"name": "V123",
"year": 2022
},
"mechanic": {
"id": 12,
"first_name": "Joe",
"last_name": "Williams",
"username": null,
"email": "joe@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"driver": {
"id": 11,
"first_name": "Demo",
"last_name": "Driver",
"username": "demo_driver",
"email": null,
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"reviewer": {
"id": 13,
"first_name": "John",
"last_name": "Williams",
"username": null,
"email": "john@example.com",
"driver_company_id": "123",
"mcleod_id": null,
"status": "active",
"role": "driver"
},
"external_ids": [
{
"external_id": "201",
"integration_name": "generic_tms"
},
{
"external_id": "Truck123",
"integration_name": "generic_maintenance_system"
}
],
"entries": [
{
"name": "Tractor Plate #",
"value": "2743186",
"position": 1
},
{
"name": "Trailer Plate #",
"value": "T473278",
"position": 2
}
]
}
}
],
"per_page": 25,
"page_no": 1,
"total": 3
}
4B: UPDATE AN EXISTING INSPECTION REPORT
Based on your use-case, once a defect is corrected you can correct that defect and once all defects have been resolved you can change the status of the entire Inspection Report as well.
NOTE
Specify the ID of the inspection report that you want to modify.
This ID can also be an external identifier.
External ID represents a unique identifier for an inspection report in an external system. The name of this external system is stored as integration_name. The combination of external_id and integration_name will always be unique.
{
"status":"corrected",
# other attributes for an inspection report
...
...
...
# add external id for inspection report
"external_ids_attributes":[
{
"external_id":"987",
"integration_name":"generic_tms"
}
]
}
To update the mechanic details, add the following defect_statuses
script to the request body. This script will append the following details:
mechanic_note
mechanic_id
mechanic_name
mechanic_name
mechanic_signed_at
resolved_defects
NOTE
The resolved_defects parameter must be an array containing the IDs of the inspected parts.
{
"defect_statuses": {
"status":"repaired",
# other attributes for defect statuses
...
...
...
# add mechanic details
"mechanic_note": "this is a mechanic note",
"mechanic_id": 1053583,
"mechanic_name": "Name of Mechanic",
"mechanic_signed_at": "2023-10-09T00:00:00-05:00",
"resolved_defects": [4311],
}
Updated 17 days ago