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.4.2.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:

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:

 

 

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>