Filtering is the way the request XML packet indicates the object (one or several customer accounts) to which the operation will be applied. Parameters nested in the filter node are called filtering rule.

The filter node is presented by the ClientSelectionFilterType complex type (client_input.xsd). Its graphical representation is as follows:

image 60516

  • The id node is optional. It specifies ID of a customer account. Data type: integer.
  • The login node is optional. It specifies login name of a customer account. Data type: string.
  • The owner-id node is optional. It specifies ID of a customer account owner. Data type: integer.
  • The owner-login node is optional. It specifies login name of a customer account owner. Data type: string.
  • The guid node is optional. It specifies the GUID of a customer account. For details on GUIDs, refer to the API RPC Protocol > GUIDs Overview section of Plesk API RPC Developer’s Guide. Data type: string.

The following packet removes customer accounts which belong to Plesk Administrator:

<packet version="1.6.3.0">
<customer>
<del>
   <filter>
      <owner-login>admin</owner-login>
   </filter>
</del>
</customer>
</packet>

The following packet deletes three customer accounts specified by id:

<packet version="1.6.3.0">
<customer>
<del>
   <filter>
      <id>124</id>
      <id>125</id>
      <id>127</id>
   </filter>
</del>
</customer>
</packet>

The following packet is identical to the previous one except that it specifies client accounts by name:

<packet version="1.6.3.0">
<customer>
<del>
   <filter>
      <login>JaneDoe</login>
      <login>RRoe</login>
      <login>JohnDoe</login>
   </filter>
</del>
</customer>
</packet>

The following packet is invalid as both the id and the login nodes are used in the same filter:

<packet version="1.6.3.0">
<customer>
<del>
   <filter>
      <login>JaneDoe</login>
      <id>125</id>
      <login>JohnDoe</login>
   </filter>
</del>
</customer>
</packet>

To fix this problem, use two different <del> sections:

<packet version="1.6.3.0">
<customer>
<del>
   <filter>
      <login>JaneDoe</login>
      <login>JohnDoe</login>
   </filter>
</del>
<del>
   <filter>
      <id>125</id>
   </filter>
</del>
</customer>
</packet>