Retrieving Mailing Lists

Use the get-list operation to retrieve preferences of specified mailing lists. Use filters to specify mailing lists by name, ID, site ID, or site name. For information on filters, refer to the Available Filters section.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving a mailing list preferences includes the get-list operation node:

<packet version="1.6.7.0">
<maillist>
<get-list>
...
</get-list>
</maillist>
</packet>

 

The get-list node is presented by the MaillistGetListInputType type (maillist.xsd), and its graphical representation is as follows:

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. For information on this filter, refer to the Available Filters section. Data type: MaillistFilterType (maillist.xsd).

Remarks

You can retrieve parameters of multiple mailing lists using different filtering rules in a single packet. Add as many get-list operations as the number of different filtering rules to be applied.

<get-list>
   ...
</get-list>
   ...
<get-list>
   ...
</get-list>
 

Response Packet Structure

The get-list node of the output XML packet is presented by type MaillistGetListOutputType (maillist.xsd) and structured as follows:

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 response retrieved from the server. Data type: ResultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the get-list operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the get-list operation fails. Data type: integer.
  • The errtext node is optional. It returns the error message if the get-list operation fails. Data type: string.
  • The filter-id node is optional. It holds the filtering rule parameter. For information, refer to the Available Filters section. Data type: anySimpleType.
  • The id node is optional. It returns ID of the mailing list in Plesk database if the operation succeeds. Data type: integer.
  • The name node is optional. It is required if the operation succeeds. It returns the name of the mailing list. Data type: string.
  • The list-status is optional. It is required if the operation succeeds. It returns the status of the mailing list. Data type: boolean.
 

Samples

Retrieving information on a single mailing list

This request packet retrieves preferences of the mailing list called MyMailer.

<packet>
<maillist>
<get-list>
   <filter>
      <name>MyMailer</name>
   </filter>
</get-list>
</maillist>
</packet>

Response:

<packet>
<maillist>
<get-list>
   <result>
      <status>ok</status>
      <filter-id>MyMailer</filter-id>
      <id>2</id>
      <name>MyMailer</name>
      <list-status>false</list-status>
   </result>
</get-list>
</maillist>
</packet>

 

If mailing list MyMailer was not found on the server, the response is as follows:

<packet>
<maillist>
<get-list>
<result>
   <status>error</status>
   <errcode>1013</errcode>
   <errtext>Maillist does not exist</errtext>
   <filter-id>MyMailer</filter-id>
</result>
</get-list>
</maillist>
</packet> 
Retrieving information on multiple mailing lists

This request packet retrieves preferences of all mailing lists on the sites with ID 1 and ID 21.

<packet>
<maillist>
<get-list>
   <filter>
      <site-id>1</site-id>
      <site-id>21</site-id>
   </filter>
</get-list>
</maillist>
</packet>

Response (if the site with ID 21 was not found on the server, and the site with ID 1 has two active mailing lists):

<packet>
<maillist>
<get-list>
   <result>
      <status>ok</status>
      <filter-id>1</filter-id>
      <id>12</id>
      <name>MailerOne</name>
      <list-status>true</list-status>
   </result>
   <result>
      <status>ok</status>
      <filter-id>1</filter-id>
      <id>17</id>
      <name>MailerTwo</name>
      <list-status>true</list-status>
   </result>
<result>
   <status>error</status>
   <errcode>1013</errcode>
   <errtext>Domain does not exist</errtext>
   <filter-id>21</filter-id>
</result>
</get-list>
</maillist>
</packet>

 

 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.