# Driver Svc Fieldforce ## Endpoints ### Dirver Pair #### Url ``` v1/drivers/{driver_id}/pair ``` #### Verb ``` POST ``` #### Request Payload ```json { "vehicle_id": int, "agent": string, "email": string } ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { "success": true, "error": null } ``` #### Response Header ``` Status: 422 Unprocessable Entity ``` #### Response Payload ```json { "error": "Couldn't process pair driver because of vehicle already paired", "status_code": 422803 } ``` ### Dirver Unpair #### Url ``` v1/drivers/{driver_id}/unpair ``` #### Verb ``` POST ``` #### Request Payload ```json { "vehicle_id": int, "agent": string, "email": string } ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { "success": true, "error": null } ``` #### Response Header ``` Status: 422 Unprocessable Entity ``` #### Response Payload ```json { "error": "Couldn't process unpair driver because of driver_id is not paired to the vehicle", "status_code": 422802 } ``` ### Get Driver by Cell #### Url ``` /v2/drivers-cell/{cell_number} ``` #### Verb ``` GET ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { "id": 7647, "payment": { "type": "cash", "account": { "number": "", "type": "" } }, "driver_name": "Yamin Platform", "profile_picture": "/uploads/img/profile/driver-01766678056", "phone_number": "01766678056", "suspended": false, "type": { "id": "car", "name": "Car Plus" }, "freelancer": true, "joining_date": "", "city": { "id": 1, "name": "Dhaka" }, "country": { "id": 1, "name": "Bangladesh" }, "vehicle": { "id": 5, "active": true, "type": null, "country": { "id": 1, "name": "Bangladesh" }, "model": { "name": "", "company": "", "series": "", "year": "", "color": "" }, "registration": { "name": "", "region": "", "series": "", "number": "" } }, "error": null } ``` #### Response Header ``` 500 Internal Server Error ``` #### Response Payload ```json { "error": "ID Not found", "status_code": 500000 } ``` ### Get Unpaired Vehicle using Reg Num #### Url ``` v2/vehicles?registration_number={reg_num}&paired=false ``` #### Verb ``` GET ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { "data": [ { "type": "motorbike", "country_id": 1, "reg_number": "HA123456", "car_company": "", "car_models": "", "car_year": "", "is_registration_verified": false, "is_fitness_certificate_verified": false, "is_tax_token_verified": false, "is_insurance_verified": false, "description": "AtlasZongshen ZS 100-27", "picture": "", "fitness_certificate": "", "tax_token": "", "insurance": "", "registration_img": "/uploads/img/profile/520_2pICqV1494758095reg.png", "fitness_certificate_img": "", "tax_token_img": "", "insurance_img": "", "user_id": 520, "is_verified": false, "category_id": 1, "route_permit": "", "color": "", "owner_address": "", "owner_details_img": "", "owner_mobile": "", "owner_name": "", "owner_nid_img": "", "owner_nid_number": "", "owner_tin_number": "", "route_permit_img": "", "route_permit_expire_at": "", "tax_token_expire_at": "", "insurance_expire_at": "", "registration_expire_at": "", "fitness_certificate_expire_at": "", "id": 0, "compliance_status": 0, "acknowledgement_slip_img": "", "acknowledgement_slip_expire_at": "", "owner_nid_back_pic": "", "owner_signature_pic": "", "owner_tin_certificate_pic": "", "brta_second_page_img": "", "tri_party_agreement_last_page_img": "" } ] } ``` #### Response Header ``` 404 Not Found ``` #### Response Payload ```json { "error": "Vehicle not found!", "status_code": 404401 } ``` ### Create Driver w/o vehicle #### Url ``` v2/drivers-wo-vehicle ``` #### Verb ``` POST ``` #### Request Payload ```json { // Same As fieldforce /v2/drivers // except there won't be any vehicle block } ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { // Same As fieldforce /v2/drivers // except there won't be any vehicle block } ``` ### Update Driver w/o vehicle #### Url ``` v2/drivers-wo-vehicle/{driver_id} ``` #### Verb ``` PATCH ``` #### Request Payload ```json { // Same As fieldforce /v2/drivers/{id} // except there won't be any vehicle block } ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { // Same As fieldforce /v2/drivers/{id} // except there won't be any vehicle block } ``` ### Create Vehicle #### Url ``` v2/vehicles ``` #### Verb ``` POST ``` #### Request Payload ```json { // Same As fieldforce /v2/drivers // except there won't be any // driver and driver_meta block } ``` #### Response Header ``` Status: 200 OK ``` #### Response Payload ```json { // Same As fieldforce /v2/drivers // except there won't be any // driver and driver_meta block } ```