Campaigns

Get all campaigns from your account

GET https://api.mailersoft.com/api/v1/campaigns/

Returns all campaigns you have in your account. Also basic summary for each campaign including the ID

Parameters

Required Parameter Description
Yes apiKey
No transactional true/false - sets the type of campaigns to return
No date_from sets date to return only campaign with emails sent from
No date_to sets date to return only campaign with emails sent to
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$campaigns = $ML_Campaigns->getAll( );

$campaigns = $ML_Campaigns->setTransactional(true)->setDateFrom('2015-03-01')->setDateTo('2015-03-31')->getAll( );

Response example

{
    "Results": [
        {
            "id": "3096"
            "name": "My first campaign",
            "from": "info@mailer.lt",
            "from_name": "Mailer Crew",
            "url": "http://app.mailer.lt/email/My-first-campaign-3096",
            "started": "2012-11-12 09:25:01",
            "done": "2012-11-12 09:25:05",
            "total": "123",
            "opens": "285",
            "uniqueOpens": "82",
            "clicks": "41",
            "unsubscribes": "3",
            "bounces": "7",
            "junk": "1",
            "transactional" => 0
        },
        {
            "id": "4589"
            "name": "My second campaign",
            "from": "info@mailer.lt",
            "from_name": "Mailer Crew",
            "url": "http://app.mailer.lt/email/My-second-campaign-4589",
            "started": "2012-11-12 09:25:01",
            "done": null,
            "total": "182",
            "opens": "365",
            "uniqueOpens": "114",
            "clicks": "23",
            "unsubscribes": "2",
            "bounces": "6",
            "junk": "1",
            "transactional" => 1
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "2"
}

Campaign details

GET https://api.mailersoft.com/api/v1/campaigns/{id}/

Retrieve stats about sent campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No tag tag name (for transactional)

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$campaign = $ML_Campaigns->setId( CAMPAIGN_ID )->get( );

$campaign = $ML_Campaigns->setId( CAMPAIGN_ID )->setTag('v.2014.03.17')->get( );

Response example

{
    "id": "3096"
    "name": "My first campaign",
    "from": "info@mailer.lt",
    "from_name": "Mailer Crew",
    "url": "http://app.mailer.lt/email/My-first-campaign-3096",
    "started": "2012-11-12 09:25:01",
    "done": "2012-11-12 09:25:05",
    "total": "123",
    "opens": "285",
    "uniqueOpens": "82",
    "clicks": "41",
    "unsubscribes": "3",
    "bounces": "7",
    "junk": "1",
    "lists": [
        {
            "id": "100043",
            "name": "Subscribers list 1",
            "date": "2014-06-19 09:30:30",
            "updated": "2015-06-02 11:34:27",
            "total": "88",
            "unsubscribed": "1",
            "bounced": "4",
            "junk": "1"
        },
        {
            "id": "124055",
            "name": "Subscribers list 2",
            "date": "2014-06-19 09:30:30",
            "updated": "2015-06-02 11:34:27",
            "total": "35",
            "unsubscribed": "2",
            "bounced": "3",
            "junk": "0"
        }
    ]
}

Campaign recipients

GET https://api.mailersoft.com/api/v1/campaigns/{id}/recipients/

Retrieves a paged result representing all the subscribers that a given campaign was sent to.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No tag tag name for subscribers only with tag to return
No date_from sets date to return only subscribers with emails sent from
No date_to sets date to return only subscribers with emails sent to
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getRecipients( );

$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->setTag('v.2014.03.17')->setDateFrom('2015-03-01')->setDateTo('2015-03-31')->getRecipients( );

Response example

{
    "Results": [
        {
            "id": 10000345,
            "email": "first@example.com",
            "date": "2015-03-01 15:45:34",
            "tag": "v.2014.03.17"
        },
        {
            "id": 10000346,
            "email": "second@example.com",
            "date": "2015-03-01 15:49:19",
            "tag": "v.2014.03.17"
        },
        {
            "id": 10000349,
            "email": "third@example.com",
            "date": "2015-03-01 15:51:16",
            "tag": "v.2014.03.17"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3",
    "Total": "1036"
}

Campaign recipient data

GET https://api.mailersoft.com/api/v1/campaigns/{recipient_id}/recipient/

Retrieve data about one concrete recipient.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the recipient you want the stats

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );

$recipientData = $ML_Campaigns->setId( RECIPIENT_ID )->getRecipientData( );

Response example

{
    "id": "2793643852",
    "opened": "4",
    "clicked": "1",
    "forwarded": "1",
    "registered": "0",
    "date": "2014-03-17 15:45:39",
    "tag": "v.2014.03.17",
    "preview_url": "http://app.mailer.lt/email/My-first-campaign-3096/0/cxqe/2793643852",
    "params": {
            "email_subject": "My first campaign",
            "email_language": "en",
            "email_to": "first@subscriber.com",
            "email_to_name": "John Smith",
    },
    "variables": {
            "Custom_Name": "Johny",
            "Surname": "Smith",
            "Age": "33"
    },
}

Campaign opens

GET https://api.mailersoft.com/api/v1/campaigns/{id}/opens/

Retrieves a paged result representing all the subscribers that opened a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getOpens( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:25",
            "email_client": "Firefox",
            "enviroment": "BROWSER"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28",
            "email_client": "Opera",
            "enviroment": "BROWSER"
        },
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:33",
            "email_client": "iPhone OS/Safari",
            "enviroment": "MOBILE"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign clicks

GET https://api.mailersoft.com/api/v1/campaigns/{id}/clicks/

Retrieves a paged result representing all the subscribers that clicked on a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getClicks( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:41:25",
            "link": "http://www.example.com",
            "email_client": "Thunderbird",
            "enviroment": "EMAIL"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:42:22",
            "link": "http://example.com/offers",
            "email_client": "iPhone OS/Safari",
            "enviroment": "MOBILE"
        },
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:43:52",
            "link": "Link to web-based version of this email from plain version",
            "email_client": "Opera",
            "enviroment": "BROWSER"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign unsubscribes

GET https://api.mailersoft.com/api/v1/campaigns/{id}/opens/

Retrieves a paged result representing all the subscribers that unsubscribed from a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getUnsubscribes( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:25"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28"
        },
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:33"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "3"
}

Campaign bounces

GET https://api.mailersoft.com/api/v1/campaigns/{id}/bounces/

Retrieves a paged result representing all the subscribers who bounced for a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getBounces( );

Response example

{
    "Results": [
        {
            "email": "first@example5.co",
            "date": "2013-02-03 15:40:25",
            "status": "hard",
            "reason": "Unable to route"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28",
            "status": "soft",
            "reason": "Mailbox is full"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "2"
}

Campaign spam complaints

GET https://api.mailersoft.com/api/v1/campaigns/{id}/junk/

Retrieves a paged result representing all the subscribers who bounced for a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want the stats for
No limit sets the limit of results in one page (default 1000)
No page you can navigate trough records by increasing page number

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getJunk( );

Response example

{
    "Results": [
        {
            "email": "first@example.com",
            "date": "2013-02-03 15:40:25"
        },
        {
            "email": "second@example.com",
            "date": "2013-02-03 15:40:28"
        }
    ],
    "Page": "1",
    "Limit": "1000",
    "RecordsOnPage": "2"
}

Campaign tags

GET https://api.mailersoft.com/api/v1/campaigns/{id}/tags/

Retrieves a result representing all the tags who where used for a given campaign.

Parameters

Required Parameter Description
Yes apiKey
Yes id The ID of the campaign you want to get tags

PHP code example

require_once('mailersoft/PHP/ML_Campaigns.php');
$ML_Campaigns = new ML_Campaigns( API_KEY );
$recipients = $ML_Campaigns->setId( CAMPAIGN_ID )->getTags( );

Response example

{
	"Results": [        
	   {           
		    "id": "123",
		    "name": "v.2014.05.12"
        
	   },        
	   {           
		    "id": "129",
		    "name": "v.2014.05.29"
        
	   },
    ],
    "RecordsOnPage": "2"
 }