3.16 Update vehicle
**Request address:** - ` /ivci/api/vehicle/updateVehicle ` **Request mode:** - 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 is decrypted into json format via RSA ``` { "userName":"testuser", "antiFake":"4bbab6ff0d8042548cc6f2df9f3655fa", "timestamp":"20160518165030", "serverIP":"127.0.0.1", "updateVehicle":{ "vehicleId":123, "approveMass":500, "burningType":"gasoline", "buyTime":"2016-06-30", "carEngine":"123456", "carVim":"vin123", "containerSize":"100,100,10", "deptId":153, "drawMass":200.00, "engineDisplacement":"test", "fueGrade":"93#", "gmtZone":"utc+0800000", "models":"vehicleType01", "oilpermile":100.00, "outFacTime":"2016-06-30", "plateNo":"B991XT", "price":100000.00, "tireNum":4, "tireSize":"100", "totalMass":200, "verandaSize":"20,20,20", "vichcleType":1, "wheelbase":100 } } ``` **Content parameter description** |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |userName | String | User name| Mandatory |antiFake | String | Anti-fake random string | Mandatory |timestamp| String | Request time stamp,accurate to second | Mandatory |serverIP | String | Server IP | Mandatory |updateVehicle | json | Add vehicle information | Mandatory |updateVehicle.vehicleId |int |Modify vehicle ID | Mandatory |updateVehicle.approveMass | int| Vehicle loading mass | | |updateVehicle.burningType | String| form of vehicle fule, refer to Appendix 3 | | |updateVehicle.buyTime | date| Purchase date | | |updateVehicle.carEngine |String| Engine number | | |updateVehicle.carVim | String| Vehicle frame number | | |updateVehicle.containerSize |String| container size,format:length,width,hight | | |updateVehicle.deptId | int| Department ID | | |updateVehicle.drawMass | double| Traction total mass | | |updateVehicle.engineDisplacement | String| Engine capacity | | |updateVehicle.fueGrade | String| Energy label | | |updateVehicle.gmtZone | String| Time zone,refer to appendix 2| | |updateVehicle.models | String| Vehicle type,need calling interface,getVehicleType,if the transmitted data cannot be queried in our system,it will show the transmitted data by users default | | |updateVehicle.oilpermile | double| fuel consumption per one hundred kilometers | | |updateVehicle.outFacTime | date| Date of manufacture | | |updateVehicle.plateNo | String| Plate number| | |updateVehicle.price |double| Purchase price | | |updateVehicle.tireNum | Int| Total number of tires | | |updateVehicle.tireSize | String| Tires specification | | |updateVehicle.totalMass |Double| Total mass | | |updateVehicle.verandaSize | String| VerandaSize,format: length,width,hight | | |updateVehicle.vichcleType | int| Vehicle category, refer to appendix 4 | | |updateVehicle.wheelbase |int| Wheelbase | | **Use exampless:** 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(); //encrypted with private key String ext=",\"updateVehicle\":{.............}";//assemble vehicle inof String dataStr="{\"userName\":\"testuser\",\"antiFake\":\""+signStr+"\",\"timestamp\":\""+timestamp+"\",\"serverIP\":\""+ip+"\" "+ext+" }"; String content=RSAUtils.encryptByPrivateKey(dataStr, privateKey); ``` 2. Front end The backend return the encrypted content to the front end, and then send the request calling. http://xxxxx/ivci/api/vehicle/updateVehicle?merchantId=100000&content=content **Return data** All return data should be in json format ```json {"code":0,"msg":"operate failed","data":{}} ``` **Return parameter** |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |code | String | Operate result code(success=0,failed=1, refer to Appendix 1 |Return| |msg |String|Operate return information(Operate succeed,return null;operate failed,return prompt information) | | |data | json | | |