3.24 Update Driver Port
**Request address:** - ` /ivci/api/driver/updateDriver ` **Request method:** - POST,GET **Parameter description** |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |content |String |Requested encrypted data |Mandatory | |merchantId |String |Request customer ID of the users | Mandatory | **Remark** content json format after decrypted via RSA ``` { "userName":"testuser", "antiFake":"4bbab6ff0d8042548cc6f2df9f3655fa", "timestamp":"20160518165030", "serverIP":"127.0.0.1", "updateDriver":{ "driverId":123, "driverName":"jasion", "birthday":"1986-10-29", "sex":1, "province":"guangdong", "city":"shenzhen", "entryTime":"2016-05-05", "deptId":153, "phoneNo":"18888888888", "email":"jasion@gmail.com", "vehicleId":12345, "licenseNo":"YB123456789", "licenseGrade":"A1", "drivingAge":3.5, "driverLabel":"chainway" } } ``` **Content parameter description** |Name|Type|Description|Remark| |:---- |:---|:----- |----- | |userName| String| User name| 必须| |antiFake| String| Anti-fake string| 必须| |timestamp| String| Request time stamp to second| 必须| |serverIP| String| Server IP| 必须| |updateDriver | json | Modify driver information |必须| |updateDriver.driverId| Int|Modify driver id| 必须 |updateDriver.driverName| String|Modify driver name| | |updateDriver.birthday| Date| Modify driver birthday| | |updateDriver.sex| Int| Driver sex,male=1,female=2| | |updateDriver.province| String| Driver province| | |updateDriver.city| String| Driver city| | |updateDriver.entryTime| Date| Driver employed time| | |updateDriver.deptId| int| Department id| | |updateDriver.phoneNo| String| Driver phone number| | |updateDriver.email| String| Driver email| | |updateDriver.vehicleId| Int| Vehicle Id, get through getUserVehicles port first| | |updateDriver.licenseNo| String| License number| | |updateDriver.licenseGrade| String| Licence grade| | |updateDriver.drivingAge| Double| Driving years| | |updateDriver.driverLabel| String| Driver label| | **Use examples:** 1. Back end ```java //read privateKeyStr String privateKey=........... //get digital signature SimpleDateFormat formatter = new SimpleDateFormat ("yyyyMMddHHmmss"); String timestamp=formatter.format(new Date()); String signStr=RSAUtils.sign(timestamp.getBytes(), privateKey); String ip=request.getRemoteAddr(); //encrypt with private key String ext=",\"updateDriver\":{.............}";//vehicle information String dataStr="{\"userName\":\"testuser\",\"antiFake\":\""+signStr+"\",\"timestamp\":\""+timestamp+"\",\"serverIP\":\""+ip+"\" "+ext+" }"; String content=RSAUtils.encryptByPrivateKey(dataStr, privateKey); ``` 2. Front end Back end returns the encrypted content to the front end, and send request http://xxxxx/ivci/api/driver/updateDriver?merchantId=100000&content=content **Return data** Return data should be in json format. ```json {"code":0,"msg":"operation failure","data":{}} ``` **Return parameter** |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |code| String| Operate result code(success=0,failure=1),refer to appendix 1 |Return| |msg| String| Operate return information(Operation success,return null,operation failure,return prompt information) | | |data| json| | |