A packet can be represented graphically in the following way:
HTTP header - a transport part. In addition to other standard information, it must contain information about the server where the operation will be performed, and the authorization data. You can use either of the authorization ways:
- the username and password of the Plesk user on behalf of which the operation will be performed.
- a secret key – a line of text that you can obtain from Plesk via XML API and then use for authorization instead of the username and password. To create a secret key, you should specify the IP address and (or) login this secret key will be linked to. Then you can specify a secret key as the KEY HTTP header of request packets. The header can look as follows:
For more information about secret keys, see the section Managing Secret Keys.
- The XML declaration:
<?xml version="1.0" encoding="UTF-8" ?>
- The packet header specifying the version of XML API.
- The packet body defining the operations that the Plesk server should perform.
Hereinafter, we refer to the packet header and body together as packet.
The packet body is structured as follows:
<[operator]> <[operation]> <[parameter1]>...</[parameter1]> ... <[parameter2]>...</[parameter2]> ... </[operation]> </[operator]>
This example shows the common structure of the packet body, with one [operator] element and one [operation] element within. In a particular implementation, labels [operator], [operation], [parameter] should be substituted by real operators, operations, and parameters. Refer to the next section for a packet sample.
Note: There can be many operation sections within one operator. Also, starting from XML API v. 126.96.36.199, a single packet allows specifying multiple operator elements.
You can look for particular values of labels [operator], [operation], and [parameter] in two places: