The get operation is used to retrieve customer account settings from the database. These settings are as follows:

  • General information about a customer (owner, name, company, contact data, and so on)
  • Statistics on this customer

To retrieve this information, send a request packet with the get operation to Plesk server.

Request Packet Structure

A request XML packet retrieving information about the customer accounts from Plesk database includes the get operation node:

<packet>
<customer>
   <get>
   ...
   </get>
</customer>
</packet>

The get node does not have a separate type, it is nested within the ClientTypeRequest complex type (client_input.xsd). The get node has the following graphics representation:

image 34168

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It specifies the filtering rule. Data type: clientSelectionFilterType (client_input.xsd). For more information on filters, refer to the Available Filters section.
  • The dataset node is required. It indicates the types of information requested from Plesk database. Data type: clientDatasetType (plesk_client.xsd).
  • The gen_info node is optional. It is used to request for the general customer account settings. Data type: none.
  • The stat node is optional. It is used to request statistics on the specified customers. Data type: none.

Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.

Response Packet Structure

The get node of the response packet is structured as follows:

image 39977

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is required. It wraps the result of the requested get operation. Data type: resultType (common.xsd).
  • The status node is required. It returns the execution status of the get operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is used to return the error code when the get operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return an error message if the get operation fails. Data type: string.
  • The filter-id node is optional. Returns the name or ID of a customer depending on a way of customer specification in the request packet. Data type: anySimple.
  • The id node is optional. It is required if the get operation succeeds. Returns the unique identifier of the customer account whose data is received from Plesk database. Data type: integer.
  • The data node is optional. It is present if the get operation succeeds. Returns a requested collection of customer settings. Data type: clientData ( plesk_client.xsd ). See the structure of this node below.

The data node is defined by complex type clientData (plesk_client.xsd). It is structured as follows:

image 57922

  • The gen_info node is optional. It returns a collection of general customer account settings. Data type: clientGetGenInfo (plesk_client.xsd). See the structure of this node in topic General Customer Account Settings.
  • The stat node is optional. It returns a the statistics collected on the specified customer account. Data type: clientStatType (plesk_client.xsd). See the structure of this node in the Statistics topic.

Samples

To get the information about the customer account, specify the packet as follows:

<packet version="1.6.7.0">
<customer>
   <get>
      <filter>
          <id>3</id>
      </filter>
      <dataset>
          <gen_info/>
          <stat/>
      </dataset>
   </get>
</customer>
</packet>

 Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <customer>
    <get>
      <result>
        <status>ok</status>
        <filter-id>3</filter-id>
        <id>3</id>
        <data>
          <gen_info>
            <cr_date>2015-12-02</cr_date>
            <cname>LogicSoft Ltd.</cname>
            <pname>Stephen Lowell</pname>
            <login>stevelow</login>
            <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>
            <locale>en-US</locale>
            <guid>ebad04d7-f762-4360-bedc-0812384538ca</guid>
            <owner-login>admin</owner-login>
            <vendor-guid>87f3014e-9f40-4428-ba19-9da16851ba40</vendor-guid>
            <external-id/>
            <description/>
            <password>$5$D9pDoFzjjx+9Jxmk$ZNhvXW2Tu</password>
            <password_type>crypt</password_type>
          </gen_info>
          <stat>
            <active_domains>0</active_domains>
            <subdomains>0</subdomains>
            <disk_space>0</disk_space>
            <postboxs>0</postboxs>
            <redirects>0</redirects>
            <mail_groups>0</mail_groups>
            <mail_resps>0</mail_resps>
            <mail_lists>0</mail_lists>
            <web_users>0</web_users>
            <data_bases>0</data_bases>
            <webapps>0</webapps>
            <traffic>0</traffic>
            <traffic_prevday>0</traffic_prevday>
          </stat>
        </data>
      </result>
    </get>
  </customer>
</packet>

To send a similar packet for multiple customer accounts, use the packet as follows:

<packet version="1.6.7.0">
<customer>
   <get>
      <filter>
          <id>1324</id>
          <id>1325</id>
      </filter>
      <dataset>
          <gen_info/>
          <stat/>
      </dataset>
   </get>
</customer>
</packet>

You cannot identify multiple customer accounts by different filtering parameters in the same filter section. The following packet is invalid:

<packet version="1.6.3.0">
<customer>
   <get>
      <filter>
          <id>1324</id>
          <login>technolux</login>
      </filter>
      <dataset>
          <gen_info/>
          <stat/>
       </dataset>
   </get>
</customer>
</packet>

To fix it, use multiple get sections:

<packet version="1.6.3.0">
<customer>
   <get>
      <filter>
          <id>1324</id>
      </filter>
      <dataset>
          <gen_info/>
          <stat/>
      </dataset>
   </get>
   <get>
      <filter>
          <login>technolux</login>
      </filter>
      <dataset>
          <gen_info/>
          <stat/>
      </dataset>
   </get>
</customer>
</packet>