getMailingLists

Description

Get a list of mailing lists.



Params

Name Type Description
apiKey string API key previously generated.
offset integer Optional parameter to specify offset.
count integer Optional parameter to specify the number of records.
id integer Optional parameter to search by id.
subject string Optional parameter to search by subject.
sortField string Optional parameter to specify a search field.
sortOrder string Optional parameter to specify a sort order. Accepted values are ASC and DESC (default).
startDate string Optional parameter to search by last sent date (beginning).
endDate string Optional parameter to search by last sent date (start).

 

Returned data

Type: array

Description: Return array with mailing lists data.

 

Json sample code

<?php

$curl = curl_init('https://your_address/ccm/admin/api/version/2/&type=json');

$postData = array(
    'function' => 'getMailingLists',
    'apiKey' => 'apiKey',
    'offset' => 0,
    'count' => 2,
);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$json = curl_exec($curl);
if ($json === false) {
    die('Request failed with error: '. curl_error($curl));
}

$result = json_decode($json);
if ($result->status == 0) {
    die('Bad status returned. Error: '. $result->error);
}

var_dump($result->data);

 

Result of API call

Array
(
    [0] => stdClass Object
        (
            [id] => 24
            [subject] => Otra prueba de envio para ejemplos del API
            [mailbox_from_id] => 1
            [mailbox_reply_id] => 1
            [mailbox_report_id] => 1
            [email_report] => 1
            [smtp_id] => 0
            [model] => 0
            [groups] => 1,3,2
            [text] => 
            [html_header] => 
            [html_style] => 
            [html] => 
	
		
	
	
            Aquí tenemos otro ejemplo de envio de boletín. También con algunos enlaces:

		

		- primer enlace

		- segundo enlace

		

	


            [attachs] => a:0:{}
            [urls] => a:0:{}
            [date] => 2012-02-13 11:07:30
            [created] => 2012-02-16 15:47:26
            [last_sent] => 2012-02-16 15:50:56
            [deleted] => 0
            [status] => idle
            [start_sent] => 2012-02-16 15:48:12
            [send_date] => 2012-02-16 15:47:00
            [subscribers_total] => 7
            [exclude_invalids] => 1
            [is_relay] => 0
            [encoding] => 
            [package_id] => 6
            [id_mailing_list_folder] => -1
            [sent_report] => 1
            [subject_encoding] => 
            [admin_id] => 0
            [url_token] => 0
            [is_spam] => 0
            [spam_report] => Spam detection software, running on the system "mail.ip-zone.com", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Aquí tenemos otro ejemplo de envio de boletín. Tambiín
   con algunos enlaces: - primer enlace - segundo enlace [...] 

Content analysis details:   (2.4 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 0.0 HTML_MESSAGE           BODY: HTML included in message
 2.4 HTML_IMAGE_ONLY_08     BODY: HTML: images with 400-800 bytes of words
-0.0 NO_RECEIVED            Informational: message has no Received headers
            [sent] => 7
            [bounced] => 1
        )

    [1] => stdClass Object
        (
            [id] => 23
            [subject] => Otra prueba de envio para ejemplos del API
            [mailbox_from_id] => 1
            [mailbox_reply_id] => 1
            [mailbox_report_id] => 1
            [email_report] => 1
            [smtp_id] => 0
            [model] => 0
            [groups] => 1,3,2
            [text] => 
            [html_header] => 
            [html_style] => 
            [html] => 
	
		
	
	
            Aquí tenemos otro ejemplo de envio de boletín. También con algunos enlaces:

		

		- primer enlace

		- segundo enlace

		

	


            [attachs] => a:0:{}
            [urls] => a:0:{}
            [date] => 2012-02-13 11:07:30
            [created] => 2012-02-16 15:46:39
            [last_sent] => 2012-02-16 15:50:56
            [deleted] => 0
            [status] => idle
            [start_sent] => 2012-02-16 15:47:25
            [send_date] => 2012-02-16 15:46:00
            [subscribers_total] => 7
            [exclude_invalids] => 1
            [is_relay] => 0
            [encoding] => 
            [package_id] => 6
            [id_mailing_list_folder] => -1
            [sent_report] => 1
            [subject_encoding] => 
            [admin_id] => 0
            [url_token] => 0
            [is_spam] => 0
            [spam_report] => Spam detection software, running on the system "mail.ip-zone.com", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Aquí tenemos otro ejemplo de envio de boletín. También
   con algunos enlaces: - primer enlace - segundo enlace [...] 

Content analysis details:   (2.4 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 0.0 HTML_MESSAGE           BODY: HTML included in message
 2.4 HTML_IMAGE_ONLY_08     BODY: HTML: images with 400-800 bytes of words
-0.0 NO_RECEIVED            Informational: message has no Received headers
            [sent] => 7
            [bounced] => 1
        )

    [2] => stdClass Object
        (
            [id] => 22
            [subject] => Envio utilizando API sendMail
            [mailbox_from_id] => 1
            [mailbox_reply_id] => 1
            [mailbox_report_id] => 1
            [email_report] => 0
            [smtp_id] => 0
            [model] => 0
            [groups] => 15
            [text] => 
            [html_header] => 
            [html_style] => 
            [html] => 
            [attachs] => a:0:{}
            [urls] => 
            [date] => 2012-02-16 13:06:20
            [created] => 2012-02-16 13:06:25
            [last_sent] => 2012-02-16 13:08:17
            [deleted] => 0
            [status] => idle
            [start_sent] => 2012-02-16 13:07:12
            [send_date] => 2012-02-16 13:06:00
            [subscribers_total] => 2
            [exclude_invalids] => 1
            [is_relay] => 0
            [encoding] => 
            [package_id] => 6
            [id_mailing_list_folder] => -3
            [sent_report] => 1
            [subject_encoding] => 
            [admin_id] => 0
            [url_token] => 0
            [is_spam] => 0
            [spam_report] => Spam detection software, running on the system "mail.ip-zone.com", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Titulo del boletí Cuerpo del boletín Titulo del boletín
Cuerpo del boletín [...] 

Content analysis details:   (1.5 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 0.0 HTML_MESSAGE           BODY: HTML included in message
 1.5 HTML_IMAGE_ONLY_04     BODY: HTML: images with 0-400 bytes of words
-0.0 NO_RECEIVED            Informational: message has no Received headers
            [sent] => 2
            [bounced] => 0
        )

    [3] => stdClass Object
        (
            [id] => 21
            [subject] => Envio utilizando API sendMail
            [mailbox_from_id] => 1
            [mailbox_reply_id] => 1
            [mailbox_report_id] => 1
            [email_report] => 0
            [smtp_id] => 0
            [model] => 0
            [groups] => 14
            [text] => 
            [html_header] => 
            [html_style] => 
            [html] => 
            [attachs] => a:0:{}
            [urls] => 
            [date] => 2012-02-16 13:06:03
            [created] => 2012-02-16 13:06:08
            [last_sent] => 2012-02-16 13:08:17
            [deleted] => 0
            [status] => idle
            [start_sent] => 2012-02-16 13:06:55
            [send_date] => 2012-02-16 13:06:00
            [subscribers_total] => 2
            [exclude_invalids] => 1
            [is_relay] => 0
            [encoding] => 
            [package_id] => 6
            [id_mailing_list_folder] => -3
            [sent_report] => 1
            [subject_encoding] => 
            [admin_id] => 0
            [url_token] => 0
            [is_spam] => 0
            [spam_report] => Spam detection software, running on the system "mail.ip-zone.com", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Titulo del boletí Cuerpo del boletín Titulo del boletín
Cuerpo del boletín [...] 

Content analysis details:   (1.5 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 0.0 HTML_MESSAGE           BODY: HTML included in message
 1.5 HTML_IMAGE_ONLY_04     BODY: HTML: images with 0-400 bytes of words
-0.0 NO_RECEIVED            Informational: message has no Received headers
            [sent] => 2
            [bounced] => 0
        )

)
Menu Title