Use the add-user operation to create a protected directory user.
A request XML packet adding a protected directory user includes the add-user operation node:
<packet>
<protected-dir>
<add-user>
...
</add-user>
</protected-dir>
</packet>
The add-user node is presented by type ProtectedDirAddUserlInput (protected_dir.xsd
), and its graphical representation is as follows:
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The add-user node of the output XML packet is presented by type ProtectedDirAddUserOutput (protected_dir.xsd
) and structured as follows:
common.xsd
).
The packet that creates user MyUser for the protected directory with ID 1 looks as follows:
<packet version="1.5.2.0">
<protected-dir>
<add-user>
<pd-id>1</pd-id>
<login>MyUser</login>
<password>12345</password>
<password-type>plain</password-type>
</add-user>
</protected-dir>
</packet>
Response:
<packet version="1.5.2.0">
<protected-dir>
<add-user>
<result>
<status>ok</status>
<id>1</id>
</result>
</add-user>
</protected-dir>
</packet>
If the user already exists, the response from the server looks as follows:
<packet version="1.5.2.0">
<protected-dir>
<add-user>
<result>
<status>error</status>
<errcode>1007</errcode>
<errtext>Specified user is already exist</errtext>
</result>
</add-user>
</protected-dir>
</packet>