Use the delete-user operation to remove a protected directory user.

Request Packet Structure

A request XML packet removing a protected directory user includes the delete-user operation node:

<packet version="1.5.2.0">
<protected-dir>
<delete-user>
...
</delete-user>
</protected-dir>
</packet>

The delete-user node is presented by type ProtectedDirDeleteUserInput (protected_dir.xsd), and its graphical representation is as follows:

image 49451

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It specifies the filtering rule. For details, refer to the Available Filters section. Data type: ProtectedDirUserFilter (protected_dir.xsd).

Response Packet Structure

The delete-user node of the output XML packet is presented by type ProtectedDirDeleteUserOutput (protected_dir.xsd) and structured as follows:

image 49463

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is required. It wraps the response retrieved from the server. Data type: resultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the operation fails. Data type: integer.
  • The errtext node is optional. It returns the error message if the operation fails. Data type: string.
  • The filter-id node is required if the request packet is valid . It returns the filtering rule parameter. For details, refer to the Available Filters section. Data type: anySimple.
  • The id node is required if the operation succeeds . It returns the ID of the removed protected directory user. Data type: integer.

Samples

Removing a single protected directory user

The packet that removes the protected user with ID 12 is as follows:

<packet>
<protected-dir>
    <delete-user>
       <filter>
          <id>12</id>
       </filter>
    </delete-user>
  </protected-dir>
</packet>

Response:

<packet>
<protected-dir>
      <delete-user>
        <result>
          <status>ok</status>
          <filter-id>12</filter-id>
          <id>12</id>
        </result>
      </delete-user>
    </protected-dir>
</packet>

If the user was not found, the response from the server looks as follows:

<protected-dir>
  <delete-user>
    <result>
     <status>error</status>
     <errcode>1013</errcode>
     <errtext>User is not found</errtext>
     <filter-id>12</filter-id>
    </result>
  </delete-user>
</protected-dir>

Removing multiple protected directory users

The packet that removes all protected users of the directory with ID 12 is as follows:

<packet>
<protected-dir>
    <delete-user>
       <filter>
          <pd-id>12</pd-id>
       </filter>
    </delete-user>
  </protected-dir>
</packet>

Response:

<packet>
<protected-dir>
      <delete-user>
        <result>
          <status>ok</status>
          <filter-id>12</filter-id>
          <id>1</id>
        </result>
        <result>
          <status>ok</status>
          <filter-id>12</filter-id>
          <id>2</id>
        </result>
      </delete-user>
    </protected-dir>
</packet>