Driver Master API

CRUD operation of driver using single api

POSThttps://yourdomain.comwebservice?token=addEditViewDriver
Request Parameters
Parameter Type Value Description
auth-codeStringheader tokenIt is Mandatory and have pass in header of the request
modeStringIt is mandatory to know for which action API is call. 0 = Insert, 1 = Update, 2 = Delete, 3 = View
project_idStringIt is mandatory field.This field indicate for which project driver action is perform.
request_dataJSON[]It is type of JSON Array.It is mandatory when API call is for Insert, Update and Delete. This will contain driver data.
request_data.employee_idStringIt is mandatory field for Update and Delete mode API call is there.It will contain only numbers. It specify the driver uniquely. Consider this as driver id which will be in the response of API call for view mode.
request_data.first_nameStringIt is mandatory field while API call for Insert or Update. This field for driver first name.It will contain alphanumeric value.
request_data.last_nameStringMandatory field while API call for Insert or Update mode. It is for driver last name.It will contain alphanumeric value.
request_data.cityStringMandatory field while API call for Insert or Update mode. This will mention driver city.It will contain alphanumeric value.
request_data.contact_no1StringMandatory field while API call for Insert or Update mode. It is for driver Contact Number.It will contain number value.
request_data.contact_no2String"0"Optional field. Driver optional contact number will mentioned here.It will contain number value.
request_data.employee_noString""Optional field. This field should mentioned only for Insert and Update mode API call. It will mentioned Employee Number.It will contain alphanumeric value
request_data.employee_tagString""Optional field. This field should mentioned only for Insert and Update mode API call. It will mentioned Employee Tag (RFID Tag).It will contain alphanumeric value
request_data.employee_tag_commentString""Optional field. This field should mentioned only for Insert and Update mode API call. It will mentioned Employee Tag (RFID) comment.It will contain alphanumeric value.
request_data.shift_idString""Optional field. It will contain alphanumeric value.This field should mentioned only for Insert and Update mode API call. It will mentioned Shift.Comma separated shift group name should mention here.
request_data.countryStringMandatory field while API call for Insert or Update mode. It will mentioned Driver country. This field contain country name.
request_data.stateStringMandatory field while API call for Insert or Update mode. It will mention driver belong from which state. It will aspect mentioned country state name.
request_data.cityStringMandatory field while API call for Insert or Update mode. It will mentioned driver belong from which city. It will aspect alphanumeric value.
request_data.zip_codeString"0"Optional field. This field accept alphanumeric value.This field should mentioned only for Insert or Update mode API call.Driver zipcode will mentioned here.
request_data.street1String""Optional field. This field accept alphanumeric value.This field should mention only for Insert or Update mode API call.Driver Street name will mentioned here.
request_data.street2String""Optional field. This field accept alphanumeric value.This field should mentioned only for Insert or Update mode API call.Driver street name will mentioned here.
request_data.default_vehicle_noString""Optional field. This field aspect vehicle number value for mentioned location (branch) name.
request_data.as_userString"no"Optional field. This field aspect yes or no value. This field used for create driver as user and able to create username and password and other detail.
request_data.date_of_birthString""Optional field. This field aspect date of birth in YYYY-MM-DD format. This field should mention only for Insert or Update API call mode.
request_data.ageString""Optional field. This field aspect alphanumeric value. This field mentioned Driver age. This field only mention for Insert or Update mode API call.
request_data.date_of_joiningString""Optional field. This field aspect date of birth in YYYY-MM-DD format. This field should mention only for Insert or Update API call mode. This field mentioned for driver joining date.
request_data.date_of_leavingString""Optional field. This field aspect date of birth in YYYY-MM-DD format. This field should mention only for Insert or Update API call mode. This field mentioned for driver leaving date.
request_data.driving_experience_sinceString"0"Optional field. This field aspect alphanumeric value. This field mentioned only for Insert or Update mode API call. This field mentioned driver driving experience since.
request_data.license_availableString"YES"Optional field. This field aspect YES or No value. This field mentioned driver has license or not.
request_data.licence_noString""Optional field. This field accept alphanumeric value. This field only mentioned when license_available value set to yes. This field mentioned driver license number.
request_data.licence_to_driveString""Optional field. This field aspect comma separated value number value license to drive category number. This field will mentioned only when Insert or Update mode API call is there, and license_available field set to yes.
request_data.licence_issued_dateString""Optional field. This field aspect value of format YYYY-MM-DD. This field only mentioned when Insert or Update mode API call is there, and license_available value set to yes.
request_data.licence_expire_dateString""Optional field. This field aspect value of format YYYY-MM-DD. This field only mentioned when Insert or Update mode API call is there, and license_available value set to yes. License expiry date will mentioned here.
request_data.health_insurance_noString""Optional field. This field accept alphanumeric value. This field only mentioned when Insert or Update mode API call is there. Health/Life Insurance number should mentioned here.
request_data.health_insurance_expire_dateString""Optional field.This field aspect YYYY-MM-DD format value. This field only mentioned when Insert or Update mode API call is there. Health/Life Insurance expiry date will mentioned here.
request_data.mediclaim_noString""Optional field.This field accept numeric value. This field only mentioned when Insert or Update mode API call is there. Driver mediclaim number will mentioned here.
request_data.mediclaim_expire_dateString""Optional field.This field aspect YYYY-MM-DD format value. This field only mentioned when Insert or Update mode API call is there.Driver mediclaim expiry date will mentioned here.
request_data.activeString"YES"Optional field. This field aspect YES or NO value. This field only mentioned when Insert or Update mode API call is there.This field mentioned driver status.
request_data.as_user_dataJSON{}Optional field. This field aspect json object value. This field will contain driver data when it is selected as user. This field only mentioned when Insert or Update mode API call is there, and mentioned as_user value to yes.
request_data.as_user_data.user_nameStringMandatory field while API call for Insert or Update mode, and as_user value is yes. This field accept alphanumeric value. This field mentioned driver user name.
request_data.as_user_data.authentication_viaString"otp"Optional field. This field mentioned while API call for Insert or Update mode, and as_user value set to yes.It aspect value
request_data.as_user_data.mobile_noStringMandatory field while API call for Insert or Update mode, as_user_value set to yes and authentication_via set to otp. This field aspect numeric value. This field aspect driver mobile number to send otp for authentication.
request_data.as_user_data.passwordStringMandatory field while API call for Insert or Update mode, as_user value set to yes, and authentication_via value set to password.This field accept alphanumeric value. This field will use while driver login as user.
request_data.as_user_data.vehicle_idStringMandatory field while API call for Insert or Update mode, and as_user value is yes. This field aspect comma separated vehicle number.
request_data.as_user_data.time_zoneString""Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect timezone name of driver. Like Asia/Kolkata
request_data.as_user_data.date_formatString"dd-MM-yyyy"Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect value dd-MM-yyyy or MM-dd-YYYY. This field mentioned driver selected date format.
request_data.as_user_data.time_formatString"12"Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect value of 12 or 24. This field mentioned driver time format.
request_data.as_user_data.language_codeString""Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect value of language short code like for English (EN).
request_data.as_user_data.mobile_app_notificationString""Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect y or n value. Driver select as y(yes) then driver able to receive notification.
request_data.as_user_data.user_statusString"Y"Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect value Y or N. This field mentioned driver as user status is active or not.
request_data.as_user_data.mobile_accessString"All"Optional field. This field mentioned while API call for Insert or Update mode, and as_user value is yes. This field aspect value All/Specific/None value. This field restrict driver access of mobile.
request_data.as_user_data.imei_noStringMandatory field while API call for Insert or Update mode, as_user value is yes, and set mobile_access value to Specific. This field accept alphanumeric value.Mobile IMEI number should mentioned here.
filter_dataJSON{}It is JSON object. It has filter value while API call for view mode.
filter_data.company_filterString""Optional field. This field mentioned while API call for View mode.It aspect numeric value of company Id. This field will use to filter driver data on company.
filter_data.location_filterString""Optional field. This field mentioned while API call for View mode. This field aspect numeric value of branch id. This field is use to filter driver of specific branch.
filter_data.employee_designation_filterString""Optional field. This field mentioned while API call for View mode. This field aspect numeric value of employee designation. Filter data for given designation.
filter_data.active_filterString""Optional field. This field mentioned while API call for View mode. This field aspect value of 'YES' or 'NO'. It will filter data on their status is active or inactive.
request_data.employee_designationString"2081"Mandatory field while API call for Insert or Update mode. It aspect employee designation id mentioned in table. This field indicate employee designation.
request_data.branch StringMandatory field. This field will contain driver branch name. This field only mentioned when Insert or Update mode API call is there.
request_data.companyStringMandatory field. This field will contain driver company name. This field only mentioned when Insert or Update mode API call is there.
Description

Method Name

addEditViewDriver

Prerequisites

Before calling this API we need to call generateAccessToken API in order to generate the token.

Description

This Master API for driver is perform add, update, delete, view action for driver.

Criteria

  1. Multiple Driver Insertion is possible
  2. Update and Delete action is possible for only single driver.
  3. For every field  which aspect date as value, provide date in YYYY-MM-dd format.

Predefined value

Mode

ModeValue
Insert0
Update1
Delete2
View3


As User

as_user value
""
yes
no


License Available

license_available value
""
YES
NO


Active

Active Value
""
YES
NO


Authentication Via

authentication_via value
""
otp
password


Date Format

date_format Value
""
dd-MM-yyyy
MM-dd-yyyy


Time Format

time_format Value
""
12
24


Mobile App Notification

mobile_app_notification Value
y
n
""


User Status

user_status Value
""
Y
N


Mobile Access

mobile_access Value
All
None

Specific


Employee Designation

Employee DesignationID
Driver
2081
Employee
2877
Engineer
8966
Supervisor
9391
Attendant
9105
Mechanic
9392


License To Drive

IDLicense To Drive
8927CAT 01
8928CAT 02
8929CAT 03
8930CAT 04
8931CAT 05
2098HMV (HGV)
2099HMV (HPV)
2100HMV (HTV)
2101HMV (HZRD)
2103HMV (RDRLR)
2102HMV (TR)
2112LL
2108LMV (ARNT)
2109LMV (ART)
2104LMV (LMV-NT)
2105LMV (LMV-T)
2106LMV (MGV)
2107LMV (MPV)
2110MCWG
2111MCWOG


Active Filter

active_filter Value
""
YES
NO


Request

Request ForJSON Request Format
0 = Insert

{

   "request_data": [

      {

         "company": "",

         "branch": "",

         "employee_designation": "2081",

         "first_name": "",

         "last_name": "",

         "employee_no": "",

         "employee_tag": "",

         "employee_tag_comment": "",

         "shift_id": "",

         "country": "",

         "state": "",

         "city": "",

         "zip_code": "0",

         "street1": "",

         "street2": "",

         "contact_no1": "",

         "contact_no2": "0",

         "default_vehicle_no": "",

         "as_user": "yes",

         "date_of_birth": "",

         "age": "",

         "date_of_joining": "",

         "date_of_leaving": "",

         "driving_experience_since": "0",

         "license_available": "",

         "licence_no": "",

         "licence_to_drive": "",

         "licence_issued_date": "",

         "licence_expire_date": "",

         "health_insurance_no": "",

         "health_insurance_expire_date": "",

         "mediclaim_no": "",

         "mediclaim_expire_date": "",

         "active": "",

         "as_user_data": {

            "user_name": "",

            "authentication_via": "otp",

            "mobile_no": "",

            "password": "",

            "vehicle_id": "",

            "time_zone": "",

            "date_format": "",

            "time_format": "",

            "language_code": "",

            "mobile_app_notification": "y",

            "user_status": "Y",

            "mobile_access": "Specific",

            "imei_no": ""

         }

      },

      {

         "company": "",

         "branch": "",

         "employee_designation": "2081",

         "first_name": "",

         "last_name": "",

         "employee_no": "",

         "employee_tag": "",

         "employee_tag_comment": "",

         "shift_id": "",

         "country": "",

         "state": "",

         "city": "",

         "zip_code": "",

         "street1": "",

         "street2": "",

         "contact_no1": "",

         "contact_no2": "0",

         "default_vehicle_no": "",

         "as_user": "no",

         "date_of_birth": "",

         "age": "",

         "date_of_joining": "",

         "date_of_leaving": "",

         "driving_experience_since": "0",

         "license_available": "",

         "licence_no": "no",

         "health_insurance_no": "",

         "health_insurance_expire_date": "",

         "mediclaim_no": "",

         "mediclaim_expire_date": "",

         "active": "",

         "as_user_data": {}

      }

   ],

   "filter_data": {},

   "mode": "0",

   "project_id": "37"

}

1 = Update

{

   "request_data": [

      {

         "employee_id" : "",

         "company": "",

         "branch": "",

         "employee_designation": "2081",

         "first_name": "",

         "last_name": "",

         "employee_no": "",

         "employee_tag": "",

         "employee_tag_comment": "",

         "shift_id": "",

         "country": "",

         "state": "",

         "city": "",

         "zip_code": "",

         "street1": "",

         "street2": "",

         "contact_no1": "",

         "contact_no2": "0",

         "default_vehicle_no": "",

         "as_user": "yes",

         "date_of_birth": "",

         "age": "",

         "date_of_joining": "",

         "date_of_leaving": "",

         "driving_experience_since": "0",

         "license_available": "yes",

         "licence_no": "",

         "licence_to_drive": "",

         "licence_issued_date": "",

         "licence_expire_date": "",

         "health_insurance_no": "",

         "health_insurance_expire_date": "",

         "mediclaim_no": "",

         "mediclaim_expire_date": "",

         "active": "",

         "as_user_data": {

            "user_name": "",

            "authentication_via": "password",

            "password": "",

            "vehicle_id": "",

            "time_zone": "",

            "date_format": "",

            "time_format": "",

            "language_code": "",

            "mobile_app_notification": "y",

            "user_status": "Y",

            "mobile_access": "All"

         }

      }

   ],

   "filter_data": {},

   "mode": "1",

   "project_id": "37"

}

2 = Delete

{

  "request_data": [

    {

      "employee_id": ""

    }

  ],

  "filter_data": {},

  "mode": "2",

  "project_id": "37"

}


3 = View

{

   "request_data": [],

   "filter_data": {

      "company_filter": "",

      "location_filter": "",

      "employee_designation_filter": "",

      "active_filter": ""

   },

   "mode": "3",

   "project_id": "37"

}



Response

KeyFormatMandatoryDescription
statusStringYesThis will mention api call result is fail or success.
messageStringYesIt will display message for api call made.
dataJSON ArrayYesIt contain data of API call response.
data.employee_idStringYesDriver Id
data.documentsStringYesDriver Document mentioned here.
data.user_nameStringYesDriver user name mentioned here.
data.verification_passwordStringYesDriver password mentioned here.
data.driving_experience_sinceStringYesDriver experience mentioned here.
data.employee_noStringYesEmployee Number value
will display here.
data.activeStringYesDriver Status mentioned here.
data.employeeStringYesDriver first name and last name value
data.typeStringYesAuthentication type is showing
data.branchStringYesCompany branch name is showing
data.passwordStringYesDriver password value is showing
data.employee_contact_noStringYesDriver Contact number is showing
data.has_userStringYesDriver is consider as user value showing
data.license_to_driveStringYesDrive have access license to drive value
data.companyStringYesCompany name
data.RFID_tagStringYesDriver RFID tag value
data.designationStringYesUser designation mentioned here
data.stateStringYesState name of driver
data.ageStringYesDriver age mentioned here
Sample Response
Success
{
    "result": 1,
    "message": "Data added successfully."
}
Success
{
    "result": 1,
    "message": "Data updated successfully."
}
Success
{
    "result": 1,
    "data": [
        {
            "driver_id": 0,
            "documents": "--",
            "user_name": "",
            "verification_password": "--",
            "driving_experience_since": "0",
            "employee_no": "--",
            "active": "Active",
            "employee": "r",
            "type": "otp",
            "branch": "",
            "password": "--",
            "employee_contact_no": "",
            "has_user": "",
            "license_to_drive": "--",
            "company": "",
            "RFID_tag": "--",
            "designation": "Driver",
            "state": "",
            "age": "--"
        }
    ],
    "message": "Data Fetch Successfully"
}
Success
{
    "result": 1,
    "message": "Data deleted successfully."
}
Fail
{
    "result": 0,
    "message": "Error Message "
}
Fail
{
    "result": 0,
    "message": "Something went wrong"
}
Fail
{
  "result": 0,
  "message": "Provide Required Parameter."
}
Fail
{
  "result": 0,
  "message": "User do not have rights for given request."
}
Fail
{
  "result": 0,
  "message": "User not found."
}
Fail
{
  "result": 0,
  "message": "Invalid Parameter"
}
Fail
{
  "result": 0,
  "message": "Refresh Token Expired"
}
Fail
{
  "result": 0,
  "message": "Invalid Token"
}
Fail
{
  "result": 0,
  "message": "Something went wrong on server"
}
Response codes
Code Description
0Fail
1Success
Error codes
Code Name Description