Introduction

Gorilla Safety started in November of 2013 as a fleet safety and risk management focused business. The founders started the business with overall safety in mind with modules designed to help fleets with CSA scores, accident investigations, repair and maintenance programs, and driver training, among other things. As the requirements for ELD were published, we were one of the first to begin full development in this space and are the first company to integrate the ELD with full fleet management solutions.

Base URL

Authentication

Most of the Gorilla Safety API calls require authentication. These calls make use of “basic authentication” in which a user name and password are combined and encoded as “Base-64”.

Driver Information

The Driver API is used to handle queries for drivers. Drivers would be allowed to query their details and search other drivers.

Fields

Tag

Data Type

Required

Description

user_id

Auto-incremented

Integer

Auto

Unique key to identify driver

first_name

varchar

First name of the driver

last_name

varchar

Last name of the driver

phone

varchar

Phone number of the driver and should be unique

email

varchar

Email address of the driver

password

varchar

Password of the driver account

license_number

varchar

License number of the driver

other_contact

varchar

Secondary contact info of the driver

joined

bit

active

bit

Key to indicate whether the driver is active or inactive for the company. ie, if the driver is removed or inactivated by the manager from the company, then the bit will be 0, otherwise 1

company_id

Integer

Company id of the driver

vehicle_id_pub

Integer

Driver’s assigned vehicle id

license_state

varchar

State in which the driver’s license is originated from

required_ELD

bit

Permission bit for the driver to use the ELD

enable_Yard_Moves

bit

Bit to indicate the driver can use yard moves or not

enable_personal_conveyance

bit

Bit to indicate the driver can use personal conveyance or not

exempt_from_ELD

bit

Bit to indicate that the user is exempt from using the eld

annotation_ELD

varchar

Reason to exempt the user from using the ELD

Exempt hire_date

varchar

Hired date of the driver to the company. ie, driver’s registration date

last_eld_used_date

varchar

Last ELD used date by the driver

Read Driver

API PATH:

api/user/{id}

METHOD:

GET

PARAMETERS:

id - Retrieves matching driver on the specified id

QUERY STRING EXAMPLES:

Get the driver record with the specified id: api/user/24

EXAMPLE RESPONSE:

{

"id": 24,

"firstName": "Riyas",

"lastName": "Latheef",

"hireDate": "11/09/2016",

"phone": "+375447100438",

"email": "riyaska@qburst.com",

"licenseNumber": "1234567",

"licenseState": "Belarus",

"otherContact": "",

"requiredELD": false,

"exemptFromEld": false,

"annotationEld": "",

"enableYardMoves": false,

"enablePersonalConveyance": false,

"lastEldUsedDate": null,

"company":{

"id": 1,

"name": "Test Tracks Company",

"address": "100 Main str. p/b 1022 Seattle WA 98104 USA",

"contactPerson": "John Smith",

"phone": "123-456-7890",

"otherLocationAddress": "",

"otherLocationContactPerson": "",

"otherLocationPhone": "",

"website": "www.company.com",

"dotNumber": "1",

"initialTrucksNumber": 1,

"city": "a",

"state": "ALABAMA",

"zipCode": "123",

"isSuspended": false,

"testMode": true,

"registrationStep": 0,

"maintenancePeriod": 1,

"maintenanceMileage": 15555,

"max2MonthsVehicles": 1,

"timeZone": "GMT+05:30",

"suspended": false

},

"mechanic": false,

"driver": true,

"fleetManager": false,

"owner": false

}

 Search Driver

API PATH:

api/user/search/{searchString}

METHOD:

GET

PARAMETERS:

searchString - Retrieves matching drivers on the specified search string

QUERY STRING EXAMPLES:

Get the driver records with the specified searchString: api/user/search/test

EXAMPLE RESPONSE:

[

{

"userId": 61,

"firstName": "TestF12",

"lastName": "TestL12",

"phone": "456-896-124",

"email": "test2@gmail.com"

},

{

"userId": 63,

"firstName": "TestF14",

"lastName": "TestL14",

"phone": "456-896-126",

"email": "test4@gmail.com"

},

{

"userId": 64,

"firstName": "TestF15",

"lastName": "TestL15",

"phone": "456-896-127",

"email": "test5@gmail.com"

},

{

"userId": 291,

"firstName": "Pasha",

"lastName": "Test Acc",

"phone": "123456",

"email": "pasha@mt2015.com"

},

{

"userId": 294,

"firstName": "TestGPS2",

"lastName": "test",

"phone": "2233344",

"email": "ice@leeching.net"

}

]

Truck Information

The Vehicle API is used to handle queries for vehicles. Drivers would be allowed to search for a vehicle, assign vehicle, assign co-driver, approve co-driver request, reject co-driver request, delete co-driver request  etc…

Fields

Tag

Data Type

Required

Description

id

ObjectId

Hexadecimal string value for the new ObjectId

idPub

Integer

Auto

Id of the vehicle

name

string

Name of the vehicle

type

string

Vehicle’s type

VIN

string

Vehicle Identification Number, it should be unique

year

Integer

Vehicle’s manufacturing year

make

string

Vehicle’s manufacturer

model

string

Model of the vehicle

plateNumber

string

Number of the vehicle

companyId

Integer

Company id of the Vehicle

gvw

string

Gross Vehicle Weight. ie, the max. Operating weight/mass of a vehicle as specified by the manufacturer

lienholder

string

A person/company who has the right of the vehicle

driverIds

Array[Integer]

List of driver ids of this vehicle

mechanicId

Integer

Id of the mechanic of this vehicle

trailerIds

Array[Integer]

List of trailer ids of this vehicle

nextMaintenance

Date

Next maintenance date of the vehicle

nextMaintenanceMileage

Double

Next maintenance mileage of the vehicle

odometer

Double

Odometer count of the vehicle at the time of registration

begDate

Date

Date in which the vehicle is registered with a company

endDate

Date

Date in which the vehicle is deleted or expired it’s contract with the company

createdByUserId

integer

User id of the manager who added/created the vehicle.

vehicleState

string

Condition of the vehicle

ibeaconRequired

bit

Bit which indicates whether the vehicle required iBeacon or not

ibeaconUuid

string

Id of iBeacon

approvalPendingCoDrivers

Array[Object]

Stores the details of the drivers who initiated a co-driver request

Search Vehicles

API PATH:

api/vehicle/search/{searchString}

METHOD:

GET

PARAMETERS:

searchString - Retrieves matching vehicles on the specified search string

QUERY STRING EXAMPLES:

Get the driver records with the specified searchString: api/vehicle/search/test

EXAMPLE RESPONSE:

"[{

"name": "Test 55676",

"type": "VACUUM",

"year": 2001,

"make": "Maker",

"model": "Model2",

"trailers":[],

"plateNumber": "PPP002",

"driverIds":[291, 3],

"vin": "Vin2",

"vehicleId": 31,

"ibeacon_required": false

},

{

"name": "Test1",

"type": "PICKUP",

"year": 2003,

"make": "Ford",

"model": "Fiesta",

"mechanic":{"id": 691, "firstName": "Ashwin", "lastName": "Thomson", "hireDate": "11/24/2016",…},

"trailers":[],

"plateNumber": "PPP001",

"driverIds":[313, 16, 691, 803],

"vin": "WF0HXXGAJH3D65150",

"vehicleId": 255,

"ibeacon_required": false

}]

Assign Vehicle to Driver

API PATH:

api/vehicle/assign/{vehicleIdPub}

METHOD:

PUT

PARAMETERS:

vehicleIdPub - Id of the vehicle to be assigned to the driver

QUERY STRING EXAMPLES:

Assigning the vehicle to the driver: api/vehicle/assign/1

EXAMPLE REQUEST:

{

  "vehicleIdPub":1

}

EXAMPLE RESPONSE:

{

"name": "Dmitry Bulat Trailer",

"type": "BOBTAIL",

"year": 2015,

"make": "MAN",

"model": "N1",

"mechanic":{

"id": 12,

"firstName": "Mechanic",

"lastName": "Four",

"hireDate": "2017-01-02",

"phone": "1-800-555-1111",

"email": "mech4@mail.com",

"licenseNumber": "",

"licenseState": null,

"otherContact": "",

"requiredELD": false,

"exemptFromEld": false,

"annotationEld": "",

"enableYardMoves": false,

"enablePersonalConveyance": false,

"lastEldUsedDate": null,

"company":{

"id": 1,

"name": "Test Tracks Company",

"address": "100 Main str. p/b 1022 Seattle WA 98104 USA",

"contactPerson": "John Smith",

"phone": "123-456-7890",

"otherLocationAddress": "",

"otherLocationContactPerson": "",

"otherLocationPhone": "",

"website": "www.company.com",

"dotNumber": "1",

"initialTrucksNumber": 1,

"city": "a",

"state": "ALABAMA",

"zipCode": "123",

"isSuspended": false,

"testMode": true,

"registrationStep": 0,

"maintenancePeriod": 1,

"maintenanceMileage": 15555,

"max2MonthsVehicles": 1,

"timeZone": "GMT+05:30",

"suspended": false

},

"mechanic": true,

"driver": false,

"fleetManager": false,

"owner": false

},

"trailers":[],

"plateNumber": "AA001AA",

"driverIds":[

7,

8,

1,

757,

702,

832,

797,

14

],

"approvalPendingCoDrivers":[

{

"coDriverId": 1,

"coDriverAssignmentStatus": "DELETE",

"assignerId": 702,

"assignerRole": "Driver",

"assignerName": "Ashik Mohan",

"assignerEmail": "ashik@qburst.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

}

],

"vin": "1",

"vehicleId": 1,

"ibeacon_required": false

}

Assign Co-driver to a Vehicle

API PATH:

api/vehicle/assignCoDriver

METHOD:

PUT

PARAMETERS:

AssignCoDriverRequestDto object

QUERY STRING EXAMPLES:

Assigning the co-driver with the passing AssignCoDriverRequestDto object api/vehicle/assignCoDriver

EXAMPLE REQUEST:

{

  "driverId":2,

  "coDriverStatus":"test",

  "vehicleIdPub":1

}

EXAMPLE RESPONSE:

"{

"name": "Dmitry Bulat Trailer",

"type": "BOBTAIL",

"year": 2015,

"make": "MAN",

"model": "N1",

"plateNumber": "AA001AA",

"companyId": 1,

"gvw": "",

"lienholder": "",

"driverIds":[

7,

8,

1,

757,

702,

832,

797,

14

],

"mechanicId": 12,

"trailerIds":[

],

"nextMaintenance": 1469697698154,

"nextMaintenanceMileage": 200,

"odometer": 416916,

"approvalPendingCoDrivers":[

{

"coDriverId": 1,

"coDriverAssignmentStatus": "DELETE",

"assignerId": 702,

"assignerRole": "Driver",

"assignerName": "Ashik Mohan",

"assignerEmail": "ashik@qburst.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

},

{

"coDriverId": 2,

"coDriverAssignmentStatus": "test",

"assignerId": 14,

"assignerRole": "Driver",

"assignerName": "Riyas Latheef",

"assignerEmail": "dm@mail.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

}

],

"vin": "1",

"vehicleId": 1,

"ibeacon_required": false

}

Approve co-driver

API PATH:

api/vehicle/coDriverApproval

METHOD:

PUT

PARAMETERS:

AssignCoDriverRequestDto object

QUERY STRING EXAMPLES:

Approving the co-driver with the passing AssignCoDriverRequestDto object api/vehicle/coDriverApproval

EXAMPLE REQUEST:

{

  "driverId":2,

  "coDriverStatus":"test",

  "vehicleIdPub":1

}

EXAMPLE RESPONSE:

{

"name": "Dmitry Bulat Trailer",

"type": "BOBTAIL",

"year": 2015,

"make": "MAN",

"model": "N1",

"mechanic":{

"id": 12,

"firstName": "Mechanic",

"lastName": "Four",

"hireDate": "2017-01-02",

"phone": "1-800-555-1111",

"email": "mech4@mail.com",

"licenseNumber": "",

"licenseState": null,

"otherContact": "",

"requiredELD": false,

"exemptFromEld": false,

"annotationEld": "",

"enableYardMoves": false,

"enablePersonalConveyance": false,

"lastEldUsedDate": null,

"company":{

"id": 1,

"name": "Test Tracks Company",

"address": "100 Main str. p/b 1022 Seattle WA 98104 USA",

"contactPerson": "John Smith",

"phone": "123-456-7890",

"otherLocationAddress": "",

"otherLocationContactPerson": "",

"otherLocationPhone": "",

"website": "www.company.com",

"dotNumber": "1",

"initialTrucksNumber": 1,

"city": "a",

"state": "ALABAMA",

"zipCode": "123",

"isSuspended": false,

"testMode": true,

"registrationStep": 0,

"maintenancePeriod": 1,

"maintenanceMileage": 15555,

"max2MonthsVehicles": 1,

"timeZone": "GMT+05:30",

"suspended": false

},

"mechanic": true,

"driver": false,

"fleetManager": false,

"owner": false

},

"trailers":[

],

"plateNumber": "AA001AA",

"driverIds":[

7,

8,

1,

757,

702,

832,

797,

14,

2

],

"approvalPendingCoDrivers":[

{

"coDriverId": 1,

"coDriverAssignmentStatus": "DELETE",

"assignerId": 702,

"assignerRole": "Driver",

"assignerName": "Ashik Mohan",

"assignerEmail": "ashik@qburst.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

},

{

"coDriverId": 2,

"coDriverAssignmentStatus": "test",

"assignerId": 14,

"assignerRole": "Driver",

"assignerName": "Riyas Latheef",

"assignerEmail": "dm@mail.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

}

],

"vin": "1",

"vehicleId": 1,

"ibeacon_required": false

}

Reject co-driver

API PATH:

api/vehicle/coDriverReject

METHOD:

PUT

PARAMETERS:

AssignCoDriverRequestDto object

QUERY STRING EXAMPLES:

Rejecting the co-driver with the passing AssignCoDriverRequestDto object api/vehicle/coDriverReject

EXAMPLE REQUEST:

{

  "driverId":2,

  "coDriverStatus":"test",

  "vehicleIdPub":1

}

EXAMPLE RESPONSE:

{

"name": "Dmitry Bulat Trailer",

"type": "BOBTAIL",

"year": 2015,

"make": "MAN",

"model": "N1",

"mechanic":{

"id": 12,

"firstName": "Mechanic",

"lastName": "Four",

"hireDate": "2017-01-02",

"phone": "1-800-555-1111",

"email": "mech4@mail.com",

"licenseNumber": "",

"licenseState": null,

"otherContact": "",

"requiredELD": false,

"exemptFromEld": false,

"annotationEld": "",

"enableYardMoves": false,

"enablePersonalConveyance": false,

"lastEldUsedDate": null,

"company":{

"id": 1,

"name": "Test Tracks Company",

"address": "100 Main str. p/b 1022 Seattle WA 98104 USA",

"contactPerson": "John Smith",

"phone": "123-456-7890",

"otherLocationAddress": "",

"otherLocationContactPerson": "",

"otherLocationPhone": "",

"website": "www.company.com",

"dotNumber": "1",

"initialTrucksNumber": 1,

"city": "a",

"state": "ALABAMA",

"zipCode": "123",

"isSuspended": false,

"testMode": true,

"registrationStep": 0,

"maintenancePeriod": 1,

"maintenanceMileage": 15555,

"max2MonthsVehicles": 1,

"timeZone": "GMT+05:30",

"suspended": false

},

"mechanic": true,

"driver": false,

"fleetManager": false,

"owner": false

},

"trailers":[],

"plateNumber": "AA001AA",

"driverIds":[

7,

8,

1,

757,

702,

832,

797,

14,

2

],

"approvalPendingCoDrivers":[

{

"coDriverId": 1,

"coDriverAssignmentStatus": "DELETE",

"assignerId": 702,

"assignerRole": "Driver",

"assignerName": "Ashik Mohan",

"assignerEmail": "ashik@qburst.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

},

{

"coDriverId": 2,

"coDriverAssignmentStatus": "test",

"assignerId": 14,

"assignerRole": "Driver",

"assignerName": "Riyas Latheef",

"assignerEmail": "dm@mail.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

}

],

"vin": "1",

"vehicleId": 1,

"ibeacon_required": false

}

Co-driver request pending approval

API PATH:

api/vehicle/pendingCoDriverRequest

METHOD:

GET

PARAMETERS:

 

QUERY STRING EXAMPLES:

Retrieving the pending co-driver requests api/vehicle/pendingCoDriverRequest

EXAMPLE RESPONSE:

[

{

"coDriverId": 1,

"coDriverAssignmentStatus": "DELETE",

"assignerId": 702,

"assignerRole": "Driver",

"assignerName": "Ashik Mohan",

"assignerEmail": "ashik@qburst.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

},

{

"coDriverId": 2,

"coDriverAssignmentStatus": "test",

"assignerId": 14,

"assignerRole": "Driver",

"assignerName": "Riyas Latheef",

"assignerEmail": "dm@mail.com",

"assignerVehicleId": 1,

"assignerVehicleName": "Dmitry Bulat Trailer"

}

]

Read vehicle drivers

API PATH:

api/vehicle/drivers/{vehicleId} or api/vehicle/drivers/{vehicleId}/{day}

METHOD:

GET

PARAMETERS:

vehicleId : retrieves the assigned drivers of the specific vehicle Id

QUERY STRING EXAMPLES:

Retrieving the assigned drivers of vehicleId:  api/vehicle/drivers/1

EXAMPLE RESPONSE:

[

{

"id": 7,

"firstName": "Driver",

"lastName": "Five",

"phone": "800-555-1111",

"email": "driver5@mail.com"

},

{

"id": 702,

"firstName": "Ashik",

"lastName": "Mohan",

"phone": "888-912-3412",

"email": "ashik@qburst.com"

}]

Company Information

The Company API is used to handle queries for company. Drivers would be allowed to retrieve the details of a company.

Fields

Tag

Data Type

Required

Description

company_id

Auto-incremented

Integer

Auto

Unique key to identify company

name

varchar

Name of the company

address

varchar

Address of the company

contact_person

varchar

Name of the contact person in company

phone

varchar

Phone number of the company

other_location_address

varchar

Company’s other address

other_location_contact_person

varchar

Name of the contact person in other location

other_location_phone

varchar

Phone number of the company in other location

website

varchar

Web address of the company

dot_number

varchar

US Dept. of Transportation registerd number of the company

initial_trucks_number

Integer

Number of trucks owned by the company at the time of registration

city

varchar

City in which the company is operating

state

varchar

State in which the company is operating

zip_code

varchar

Zip code of company’s registered address

is_suspended

bit

Bit to indicate whether the company is active or suspended (due to unpaid bills or due to contract expiration)

test_mode

bit

Bit to indicate whether the company is free to check the contract expiration

reg_step

Integer

The count of steps during the registration

maintenance_period

Integer

Maintenance period, in months

maintenance_mileage

Integer

Maintenance mileage, in miles

stripe_id

varchar

Stripe id of the company

cost_per_truck

Integer

amount in cents per one truck monthly

discount

Double

percentage of discount in payment

max_2_months_vehicles

Integer

The max amount of vehicles for the first two months

suspend_reason

varchar

Reason to suspend a company

timeZone

varchar

Time zone in which the comapny is operating

accidentEmails

varchar

Emails to send letters about the accident

suspendedDate

Date

Suspended date of company

Read company information

API PATH:

api/company/{id}

METHOD:

GET

PARAMETERS:

id : Retrieves matching company with the specified id

QUERY STRING EXAMPLES:

Get the company record with the specified id:  api/company/1

EXAMPLE RESPONSE:

{

"id": 1,

"name": "Test Tracks Company",

"address": "100 Main str. p/b 1022 Seattle WA 98104 USA",

"contactPerson": "John Smith",

"phone": "123-456-7890",

"otherLocationAddress": "",

"otherLocationContactPerson": "",

"otherLocationPhone": "",

"website": "www.company.com",

"dotNumber": "1",

"initialTrucksNumber": 1,

"city": "a",

"state": "ALABAMA",

"zipCode": "123",

"isSuspended": false,

"testMode": true,

"registrationStep": 0,

"maintenancePeriod": 1,

"maintenanceMileage": 15555,

"max2MonthsVehicles": 1,

"timeZone": "GMT+05:30",

"suspended": false

}

GPS Information

The GPS info API is used to save coordinates of a vehicle.

Fields

Tag

Data Type

Required

Description

id

ObjectId

Hexadecimal string value for the new ObjectId

vehicleIdPub

Integer

Id of the vehicle

locOld

Object

Old location of the vehicle

locNew

Object

New location of the vehicle

distance

Double

Distance travelled in miles

date

Date

Date in which this GPS info is generated

driverState

String

State of the driver

state

String

The US state

eldState

String

Status of ELD

geocodedLocation

String

Location corresponding to the coordinates

roadName

String

Road name in the location

distanceBetweenGeocodedPoints

Double

Distance between the coordinates

odometer

Double

Odometer value of the vehicle at the location

engineHours

Double

Engine hours of the vehicle

locationEntryType

Object

Object indicating the type of location whether it is automatically generated or manually entered

 

Save vehicle coordinates

API PATH:

api/coordinates

METHOD:

POST

PARAMETERS:

List of VehicleCoordinatesDto object

QUERY STRING EXAMPLES:

Saving the list of VehicleCoordinatesDto object: api/coordinates

EXAMPLE REQUEST:

[{

  "vehicleIdPub":1,

  "locOld":[27.516,56.253],

  "locNew":[53.908,69.369],

  "distance":0.014,

  "date":1488949461000,

  "driverState":"DRIVING",

  "eldState":"NOT_STARTED",

  "usState":"CA",

  "odometer":12.4,

  "engineHours":0,

  "locationEntryType":"AUTO"

},{

  "vehicleIdPub":1,

  "locOld":[35.516,98.253],

  "locNew":[64.908,88.369],

  "distance":0.014,

  "date":1488949461000,

  "driverState":"ON_DUTY",

  "eldState":"NOT_STARTED",

  "state":"CA",

  "odometer":123,

  "engineHours":0,

  "locationEntryType":"AUTO"

}

]

EXAMPLE RESPONSE: