3.1 Add organization architecture interface: addDeptInfo
**Request address:** - ` /ivci/api/dept/addDeptInfo ` **Request mode:** - POST,GET **Parameter description** |Parameter name|Type|Description|Remark| |:---- |:---|:----- |----- | |content |String |Request encrypted data |Mandatory | |merchantId |String |Request customer ID of the users | Mandatory | **Note** Content json format after decrypted via RSA: ``` { "userName" : "testuser", "antiFake" : "4bbab6ff0d8042548cc6f2df9f3655fa", "timestamp" : "20160518165030", "serverIP" : "127.0.0.1", "addDept" : { "deptName" : "test department", "depfsId" : "0", "deptAddress" : "Shenzhen, Guangdong Prov.", "personinCharge" : "jasion", "personinPhone" : "18888888888" } } ``` **Content parameter description** |Name|Type|Description|Remark| |:---- |:---|:----- |----- | |userName|String|Username|Mandatory| |antiFake| String|Anti-fake random string|Mandatory| |timestamp|String|Request timestamp, accurate to second|Mandatory| |serverIP| String|Server IP|Mandatory| |addDept|json| Add department information|Mandatory| |addDept.deptName|String|Add department name|Mandatory| |addDept.depfsId|String|Add superior of department, if not pass argument, then use the current user’s department.| Optional| |addDept.deptAddress|String|Add department address|Optional| |addDept.personinCharge|String|Add department server|Optional| |addDept.personinPhone|String|Add department director phone number|Optional| **Use examples:** 1. Back end ```java //Read privateKeyStr String privateKey=........... //Acquire data signature SimpleDateFormat formatter = new SimpleDateFormat ("yyyyMMddHHmmss"); String timestamp=formatter.format(new Date()); String signStr=RSAUtils.sign(timestamp.getBytes(), privateKey); String ip=request.getRemoteAddr(); //Encrypting with private key String ext=",\"addDept\":{.............}";//Add department information String dataStr="{\"userName\":\"testuser\",\"antiFake\":\""+signStr+"\",\"timestamp\":\""+timestamp+"\",\"serverIP\":\""+ip+"\" "+ext+" }"; String content=RSAUtils.encryptByPrivateKey(dataStr, privateKey); ``` 2. Front end The background returns the encrypted content to the front-end, and then sends the request. http://xxxxx/ivci/api/dept/addDeptInfo?merchantId=100000&content=content **Return data** All 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|Return| |msg|String|Operate return message (If success, return null; failure, return prompt message )| | |data|String|{“deptId”:123}|Return| Return data need to be decoded, the decryption process is as follows: ```java String key="......"; String mi="56D56B912C68308AA6D863DE087DBFD82D65C37836FC15E0B92"; String ming=RSAUtils.decryptByPrivateKey(mi, key); ```