3.13Querythe user-accessible role port (getUserPrisRoleList)
**Request address:** - `/ivci/api/role/getUserPrisRoleList` **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 |Type|Description|Remark| |:---- |:---|:----- |----- | |userName | String | User name |Mandatory| |antiFake | String | Anti-fake random string | Mandatory| |timestamp | String| Request timestamp, accurate to second |Mandatory| |serverIP | String| Sever IP | Mandatory| |queryRole | Json | Query user infomation |Optional| |queryRole.deptId | Int| Department ID of role (if transmit the ID,query role information according to department ID,if not transmi,it default query current department of requested user. | Optional| **Use exampless:** 1. Back end ```java //read privateKeyStr String privateKey=........... //Obtain data 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 returns encrypted content to the front-end, and then sends the request calling http://xxxxx/ivci/api/role/getUserPrisRoleList?merchantId=100000&content=content **Return data** Return data is in json format ```json {"code":0,"msg":"operation failure","data":{}} ``` **Return data** |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 | operate return data result(operate succeed,return result),for example,query succeed,it will return correct data,For querying the data that has been returned successfully, if query it in batch, data will be returned. If query is single, json object will be received. For deleting, updating or other operations, return null, which means no data is returned.| | Return data need to be decoded, the decryption process is as follows: ```java String key="......"; String mi="56D56B912C68308AA6D863DE087DBFD82D65C37836FC15E0B92"; String ming=RSAUtils.decryptByPrivateKey(mi, key); ```