Driver Master API
CRUD operation of driver using single api
Request Parameters
Parameter | Type | Value | Description |
---|---|---|---|
auth-code | String | header token | It is Mandatory and have pass in header of the request |
mode | String | It is mandatory to know for which action API is call. 0 = Insert, 1 = Update, 2 = Delete, 3 = View | |
project_id | String | It is mandatory field.This field indicate for which project driver action is perform. | |
request_data | JSON | [] | 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_id | String | It 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_name | String | It is mandatory field while API call for Insert or Update. This field for driver first name.It will contain alphanumeric value. | |
request_data.last_name | String | Mandatory field while API call for Insert or Update mode. It is for driver last name.It will contain alphanumeric value. | |
request_data.city | String | Mandatory field while API call for Insert or Update mode. This will mention driver city.It will contain alphanumeric value. | |
request_data.contact_no1 | String | Mandatory field while API call for Insert or Update mode. It is for driver Contact Number.It will contain number value. | |
request_data.contact_no2 | String | "0" | Optional field. Driver optional contact number will mentioned here.It will contain number value. |
request_data.employee_no | String | "" | 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_tag | String | "" | 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_comment | String | "" | 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_id | String | "" | 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.country | String | Mandatory field while API call for Insert or Update mode. It will mentioned Driver country. This field contain country name. | |
request_data.state | String | Mandatory 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.city | String | Mandatory 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_code | String | "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.street1 | String | "" | 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.street2 | String | "" | 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_no | String | "" | Optional field. This field aspect vehicle number value for mentioned location (branch) name. |
request_data.as_user | String | "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_birth | String | "" | 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.age | String | "" | 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_joining | String | "" | 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_leaving | String | "" | 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_since | String | "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_available | String | "YES" | Optional field. This field aspect YES or No value. This field mentioned driver has license or not. |
request_data.licence_no | String | "" | 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_drive | String | "" | 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_date | String | "" | 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_date | String | "" | 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_no | String | "" | 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_date | String | "" | 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_no | String | "" | 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_date | String | "" | 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.active | String | "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_data | JSON | {} | 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_name | String | Mandatory 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_via | String | "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_no | String | Mandatory 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.password | String | Mandatory 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_id | String | Mandatory 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_zone | String | "" | 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_format | String | "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_format | String | "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_code | String | "" | 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_notification | String | "" | 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_status | String | "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_access | String | "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_no | String | Mandatory 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_data | JSON | {} | It is JSON object. It has filter value while API call for view mode. |
filter_data.company_filter | String | "" | 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_filter | String | "" | 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_filter | String | "" | 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_filter | String | "" | 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_designation | String | "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 | String | Mandatory field. This field will contain driver branch name. This field only mentioned when Insert or Update mode API call is there. | |
request_data.company | String | Mandatory 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
- Multiple Driver Insertion is possible
- Update and Delete action is possible for only single driver.
- For every field which aspect date as value, provide date in YYYY-MM-dd format.
Predefined value
Mode
Mode | Value |
Insert | 0 |
Update | 1 |
Delete | 2 |
View | 3 |
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 Designation | ID |
Driver | 2081 |
Employee | 2877 |
Engineer | 8966 |
Supervisor | 9391 |
Attendant | 9105 |
Mechanic | 9392 |
License To Drive
ID | License To Drive |
8927 | CAT 01 |
8928 | CAT 02 |
8929 | CAT 03 |
8930 | CAT 04 |
8931 | CAT 05 |
2098 | HMV (HGV) |
2099 | HMV (HPV) |
2100 | HMV (HTV) |
2101 | HMV (HZRD) |
2103 | HMV (RDRLR) |
2102 | HMV (TR) |
2112 | LL |
2108 | LMV (ARNT) |
2109 | LMV (ART) |
2104 | LMV (LMV-NT) |
2105 | LMV (LMV-T) |
2106 | LMV (MGV) |
2107 | LMV (MPV) |
2110 | MCWG |
2111 | MCWOG |
Active Filter
active_filter Value |
"" |
YES |
NO |
Request
Request For | JSON 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
Key | Format | Mandatory | Description |
status | String | Yes | This will mention api call result is fail or success. |
message | String | Yes | It will display message for api call made. |
data | JSON Array | Yes | It contain data of API call response. |
data.employee_id | String | Yes | Driver Id |
data.documents | String | Yes | Driver Document mentioned here. |
data.user_name | String | Yes | Driver user name mentioned here. |
data.verification_password | String | Yes | Driver password mentioned here. |
data.driving_experience_since | String | Yes | Driver experience mentioned here. |
data.employee_no | String | Yes | Employee Number value will display here. |
data.active | String | Yes | Driver Status mentioned here. |
data.employee | String | Yes | Driver first name and last name value |
data.type | String | Yes | Authentication type is showing |
data.branch | String | Yes | Company branch name is showing |
data.password | String | Yes | Driver password value is showing |
data.employee_contact_no | String | Yes | Driver Contact number is showing |
data.has_user | String | Yes | Driver is consider as user value showing |
data.license_to_drive | String | Yes | Drive have access license to drive value |
data.company | String | Yes | Company name |
data.RFID_tag | String | Yes | Driver RFID tag value |
data.designation | String | Yes | User designation mentioned here |
data.state | String | Yes | State name of driver |
data.age | String | Yes | Driver 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 |
---|---|
0 | Fail |
1 | Success |
Error codes
Code | Name | Description |
---|