3.17Query vehicle
**Request address:** - `/ivci/api/vehicle/getVehicleById` **Request mode:** - POST,GET **Parameter description** |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |content |String |Requested encrypted data |Mandatory | |merchantId |String |Customer name of the request user | Mandatory | **Remark** Content is decrypted into json format via RSA ``` { "userName":"testuser", "antiFake":"4bbab6ff0d8042548cc6f2df9f3655fa", "timestamp":"20160518165030", "serverIP":"127.0.0.1", "queryVehicle":{ "vehicleId":123 } } ``` **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| |queryVehicle | json | Query vehicle info | Mandatory| |queryVehicle.vehicleId| int| Query vehicle ID| Mandatory| **Use exampless:** 1. Backend ```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=",\"queryVehicle\":{.............}";//assemble vehicle info 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/getVehicleById?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 | Mandatory| |msg| String| Operate return information(Operate succeed,return null;operate failed,return prompt information)| | |data | json | | | **Return vehicle info data** |Parameter name|type|description|remark| |:---- |:---|:----- |----- | |annualVerificationDate | String | Annual inspection period| | |approveMass |String | Vehicle loading mass| | |brand | String | Branch| | |burningType |String | Form of fuel| | |buyTime |date | Purchase date| | |carColor | String | Vehicle color| | |carEngine | String | Engine number| | |carPhoto | String | Vehicle photos| | |carStatus | Int |Vehicle status| | |carVim | String | Vehicle frame number| | |companyId | Integer |subordinate companies Id(same as deptId) | | |containerSize | String | Container size| | |createBy | Int |Creator| | |createTime | date | Create date| | |defaultFue | String | Default energy| | |deptId | Int |Department Id| | |deptName | String | Department name| | |drawMass | Double | Total traction weight| | |driverId | Int |Driver id| | |driverName | String | Driver name| | |driverCount |Int |Number of drivers| | |drivingLicensePhoto |String | Driver's license photo| | |engineDisplacement | String | Engine capacity| | |equipmentPn |String | Bind device PN| | |equipmentSn |String | Bind device SN| | |equipmentVersion | String | Bind device version| | |fueGrade | String | Energy labeling| | |gmtZone |String | Time zone| | |imgType |String | Image type| | |inspectionPeriod | String | Annual inspection period | | |insuranceClaimsPhone | String | Claims phone number| | |insuranceCompany | String | Insurance company| | |insuranceEffectTime |Date | Effective date of the policy| | |insuranceExpense | Double | Insurance policy number| | |insuranceNo |String | Insurance No.| | |insurancePeriod |Double | Insurance period| | |isDel | Int |Delete or not| | |licenseNo | String | Driver licence No.| | |metermileage | Double | Vehicle mileage| | |models | String | Vehicle type| | |modelsName | String | Vehicle mode name| | |oilpermile | Double | Fuel consumption per one hundred kilometer| | |operationLicensePhoto | String | Vehicle operation manual photo| | |outFacTime | Date | Date of manufacture| | |plateNo |String | Plate number| | |price | Double | Vehicle price,unit/$| | |tireNum |int |Total number of tires| | |tireSize | String | Tire specification| | |totalMass | Double | Total mass| | |updateUser | Int |Update user id| | |vehicleId | Int |Vehicle id| | |verandaSize |String | Veranda size,format:length,width,height | | |vichcleType |String | Vehicle category| | |wheelbase | Int |Wheelbase| | Return data need to be decoded, the decryption process is as follows: ```java String key="......"; String mi="56D56B912C68308AA6D863DE087DBFD82D65C37836FC15E0B92"; String ming=RSAUtils.decryptByPrivateKey(mi, key); ```