Retrieving Information On FTP Accounts

The get operation is used to retrieve the following FTP account settings:

You can retrieve information on several FTP accounts in a single get operation by defining the filtering rule. Use the blank filter (<filter/>) parameter to get information about all FTP accounts on all sites for the user identified by credentials from HTTP header.

 

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving information on FTP account settings includes the get operation node:

<packet>
<ftp-user>
   <get>
   ...
   </get>
</ftp-user>
</packet>

 

The get node is presented by the FtpUserGetInputType complex type (ftpuser.xsd). The node has the following graphical representation:

 

Remarks

Within one get operation you can retrieve information on FTP accounts using only one filtering rule: account IDs, account names, site IDs, or site names. However, you can always use several different filtering rules within one packet by including to it several get nodes.

 

Response Packet Structure

The get node of the output XML packet is structured as follows:

ftpuser_get

 

Remarks

In case when a site was specified as filtering rule in a request packet, and there are no FTP accounts existing on that site, response packet does not contain the name, home, quota, permissions and site-id nodes.

 

Samples

Retrieving information on a single FTP account

This packet retrieves information on FTP account with ID 16.

<packet>
<ftp-user>
<get>
   <filter>
      <id>16</id>
   </filter>
</get>
</ftp-user>
</packet>

Response:

<packet>
<ftp-user>
<get>
   <result>
      <status>ok</status>
      <filter-id>16</filter-id>
      <id>16</id>
      <name>jenny</name>
      <home></home>
      <quota>-1</quota>
      <permissions>
         <read>false</read>
         <write>false</write>
      </permissions>
      <webspace-id>1</webspace-id>
   </result>
</get>
</ftp-user>
</packet>
Retrieving information on multiple FTP accounts

This packet retrieves information on FTP accounts with names photo1 and photo3, and on all FTP accounts existing on site with ID 34.

<packet>
<ftp-user>
<get>
   <filter>
      <name>photo1</name>
      <name>photo3</name>
   </filter>
</get>
<get>
   <filter>
      <site-id>34</site-id>
   </filter>
</get>
</ftp-user>
</packet>

Response:

<packet>
<ftp-user>
<get>
   <result>
      <status>ok</status>
      <filter-id>photo1</filter-id>
      <id>7</id>
      <name>photo1</name>
      <home>/private/photoshare/Incoming</home>
      <quota>104857600</quota>
      <permissions>
         <read>true</read>
         <write>true</write>
      </permissions>
      <webspace-id>2</webspace-id>
   </result>
   <result>
      <status>ok</status>
      <filter-id>photo3</filter-id>
      <id>9</id>
      <name>photo3</name>
      <home>/private/photoshare/Incoming</home>
      <quota>0</quota>
      <permissions>
         <read>true</read>
         <write>false</write>
      </permissions>
      <webspace-id>2</webspace-id>
   </result>
</get>
<get>
   <result>
      <status>ok</status>
      <filter-id>34</filter-id>
   </result>
</get>
</ftp-user>
</packet> 
Retrieving information on all FTP accounts existing on all sites created in Plesk

This packet retrieves information on all FTP accounts existing on all sites created in Plesk if it is sent with Plesk Administrator credentials in the packet HTTP headers, or on all sites belonging to a Plesk customer whose credentials are specified in the HTTP headers.

<packet>
<ftp-user>
<get>
   <filter/>
</get>
</ftp-user>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <ftp-user>
    <get>
      <result>
        <status>ok</status>
        <filter-id>1</filter-id>
        <id>1</id>
        <name>ftpuser1</name>
        <home>/</home>
        <webspace-id>1</webspace-id>
      </result>
      <result>
        <status>ok</status>
        <filter-id>2</filter-id>
        <id>2</id>
        <name>photo1</name>
        <home>/private/photoshare/Incoming</home>
        <webspace-id>6</webspace-id>
      </result>
      <result>
        <status>ok</status>
        <filter-id>3</filter-id>
        <id>3</id>
        <name>photo2</name>
        <home>/private/photoshare/Incoming</home>
        <webspace-id>6</webspace-id>
      </result>
      <result>
        <status>ok</status>
        <filter-id>4</filter-id>
        <id>4</id>
        <name>photo3</name>
        <home>/private/photoshare/Incoming</home>
        <webspace-id>6</webspace-id>
      </result>
    </get>
  </ftp-user>
</packet>