A Sample Packet
Here is an example of a request packet sent to the Plesk server:
|
HTTP header The HTTP header indicates that the HTTP method used is POST,
the handling agent is located at
|
---|---|
<?xml version="1.0" encoding="UTF-8"?> |
XML declaration |
<packet> |
Packet header |
<customer> <add> <gen_info> <cname>LogicSoft Ltd.</cname> <pname>Stephen Lowell</pname> <login>stevelow</login> <passwd>Jhtr66fBB</passwd> <status>0</status> <phone>416 907 9944</phone> <fax>928 752 3905</fax> <email>host@logicsoft.net</email> <address>105 Brisbane Road, Unit 2</address> <city>Toronto</city> <state/> <pcode/> <country>CA</country> </gen_info> </add> </customer> |
Packet body Always starts from the tag of the related operator. This particular packet uses the customer operator to create a customer account. The elements nested within the gen_info node contain the profile details. |
The structure of the packet body is compliant with the
client_input.xsd XML schema of XML API 1.6.3.0. |
|
</packet> |
Trailing tag closing the packet |
Note: Instead of the lines HTTP_AUTH_LOGIN: admin
and
HTTP_AUTH_PASSWD: setup
in the request packet header, you can
specify a secret key, for example:
KEY: 6575fae36288be6d1bad40b99808e37f
. For more information about
the secret keys, see the section Managing Secret
Keys.
The example above shows the request message structure. Both types are similar in the structure, but HTTP headers and bodies look different. Message sent by the server in response to the request above could look as follows:
|
Standard header of the HTTP server response The MIME type is text/xml. |
---|---|
<?xml version="1.0" encoding="UTF-8"?> |
Standard header of a valid XML document |
<packet> |
XML packet header |
<customer> <add> <result> <status>ok</status> <id>4</id> <guid>0e35bf3c-5eb0-4006-98c6-5ce4ef4a08a7</guid> </result> </add> </customer> |
Packet body The root node of the packet body is the customer operator. The nested lines indicate that the ADD operation was successfully performed. Also, the server passes back the account ID. The structure of the packet body is compliant with the
|
</packet> |
Trailing tag closing the packet |