3.25 Query driver interface
**Request address:** - `/ivci/api/driver/getDriverById` **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", "deleteDriver":{ "ids":"123,456" } } ``` **Content parameter description** |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| |queryDriver |json | Query driver information| Mandatory| |queryDriver.driverId | Int| Query driver id |Mandatory| **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=",\"queryDriver\":{.............}";//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/getDriverById?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 | Mandatory| |msg| String| Operate return informatio(Operation success,return null,operation failure,return prompt information)| | |data| json| Driver information| Mandatory| Data structure, as follow: ```javascript "data":{ "driving_age":3.5, "license_grade":"A1", "update_time":null, "recruitment":null, "province":"guangdong", "city":"shenzhen", "email":"jasion@gmail.com", "entry_time":1462377600000, "job_number":null, "age":null, "sex":1, "birthday":530899200000, "note":null, "ids":null, "phone_no":"18888888888", "dept_name":"test 10", "license_no":"YB123456789", "createby":null, "is_del":null, "vehicle_id":null, "company_id":null, "creattime":null, "driver_id":9950, "dept_id":153, "plate_no":"AV5557", "license_photo":null, "driver_photo":null, "driver_label":"chainway", "driver_name":"jasion", "update_user":null } ``` return driver data description |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |driving_age |Double| Driving years| | |license_grade | String| License grade| | |update_time |date| Update time| | |province | String| Driver province| | |city | String| Driver city| | |email | String| Driver email| | |entry_time | Long| Employed time, time stamp is Long| | |job_number | String| Job number| | |age |Int| Age| | |set |Int| Sex,male=1,female=2| | |birthday | Long| Driver birthday, time stamp is Long| | |note | String| Note| | |phone_no | String| Driver phone number| | |dept_name | String| Department name| | |license_no | String| Licence number| | |createby | String| Creator| | |is_del | Int| Delete or not,delete=1, not delete=0 | | |vehicle_id | Int|Vehicle id| | |company_id | Int| Company Id, Same as the toppest Id| | |creattime | Long| Create time| | |driver_id | Int| Driver id| | |dept_id |Int|Department id| | |plate_no | String| Plate number| | |license_photo | String| License photo| | |driver_label | String| Driver label| | |driver_name |String| Driver name| | |update_user |Int| Modify user id| | Return data should be decrypted, the decryption process is as follow: ```java String key="......"; String mi="56D56B912C68308AA6D863DE087DBFD82D65C37836FC15E0B92"; String ming=RSAUtils.decryptByPrivateKey(mi, key); ```