Assume that you need to create a customer account and remove accounts with IDs 1324 and 1325. Also assume that you know the Plesk version, say, it is Plesk 10.4. Then according to the protocol-product table, the best choice is to use XML API 126.96.36.199 since Plesk 10.4 ships with this protocol version.
Start with adding the packet node and defining the protocol version. You should have a similar packet:
Then open the reference part of the document, find the section about operations on customer accounts - Managing Customer Accounts, and construct the packet you need using the notation, descriptions, and samples.
To learn how to read graphical notations corresponding to operations, see Before Using Reference.
According to the example, a packet will be extended to:
Here, the requested operations (add and del) are nested within the customer operator element. XML API supports requests for operations on multiple Plesk objects. This request packet is also valid:
The operations are performed sequentially. Each group of operations is isolated within the relevant operator so that operations with similar names requested for different Plesk objects would never conflict.
For details on how to execute the operation described by a packet by programming means, see Creating Client Software.
The Order of Elements
Important: The order of nodes and elements within operations in your request packet is important. In most cases, the order must be the same as in the corresponding schema (or graphical notation).
For example, when creating mail accounts, you use the following packet structure:
According to the packet structure, the right order of elements within the mailname node is:
And the wrong order is: