Use the create operation to create a secret key.
Note: To create a secret key, you should specify the IP address this secret key will be linked to. Packets sent with this key from different IP's will not be proceeded by Plesk API RPC service.
A request XML packet creating a secret key includes the create operation node:
<packet>
<secret_key>
<create>
...
</create>
</secret_key>
</packet>
The create node has the following graphical representation:
common.xsd
).
Remarks
You can create multiple secret keys in a single packet. Add as many create operations as the number of keys to be created.
<create>
...
</create>
...
<create>
...
</create>
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The create node of the output XML packet is structured as follows:
common.xsd
).
This request packet creates the secret key for IP 192.0.2.1.
<packet>
<secret_key>
<create>
<ip_address>192.0.2.1</ip_address>
</create>
</secret_key>
</packet>
Response:
<packet>
<secret_key>
<create>
<result>
<status>ok</status>
<key>6575fae36288be6d1bad40b99808e37f</key>
</result>
</create>
</secret_key>
</packet>
This request packet creates the secret key linked to IP 192.0.2.1 for the customer user_demo.
<packet>
<secret_key>
<create>
<ip_address>192.0.2.1</ip_address>
<login>user_demo</login>
</create>
</secret_key>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.8.0">
<secret_key>
<create>
<result>
<status>ok</status>
<key>c5b239d1-8eb6-8cee-76b7-aa16be37fee8</key>
</result>
</create>
</secret_key>
</packet>
This request packet creates secret keys for User1, and for User2.
<packet>
<secret_key>
<create>
<ip_address>192.0.2.2</ip_address>
<description>For User1</description>
</create>
<create>
<ip_address>192.0.2.3</ip_address>
<description>For User2</description>
</create>
</secret_key>
</packet>
Response:
<packet>
<secret_key>
<create>
<result>
<status>ok</status>
<key>6575fae36288be6d1bad40b99808e37f</key>
</result>
</create>
<create>
<result>
<status>ok</status>
<key>e1b9288a886c82f652921a34ea5e3e62</key>
</result>
</create>
</secret_key>
</packet>