3.18 Query VehicleType port
**Request address:** - `/ivci/api/vehicle/getVehicleType` **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" } ``` **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| **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=""; 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/getVehicleType?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| Operat 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| Vehicle type json tree |Return| Structure of data,as follows: ```javascript data":[{ "id":"1", "name":"HONDA", "children":[{ "id":"1151", "name":"Toyota", "children":[{ "id":"1662", "name":"Toyota", "parent":"1151", "print":0},{ "id":"2281", "name":"else", "parent":"1151", "print":0}], "parent":"1", "print":0}], "parent":"1", "print":0}] ``` Return data need to be decoded,the decryption process is as follows: ```java String key="......"; String mi="56D56B912C68308AA6D863DE087DBFD82D65C37836FC15E0B92"; String ming=RSAUtils.decryptByPrivateKey(mi, key); ```