Managing Email Campaigns

Creating an Email Campaign
 
 
JSON Data Example for HTTP Request:

{
  "from_email":"hello@world.com",
  "subject":"Hello World",
  "text":"Hello World",
  "html":"<h1>Hello World</h1>",
  "lists":[
    {
      "id":"1"
    }
  ]
}


 
HTTP Request Example

curl -X POST https://api.msndr.net/v1/email/campaigns \
     -H 'Content-Type: application/json'              \
     -H 'Authorization: Bearer $API_TOKEN'            \
     -d '...JSON...'


 
HTTP Request Example (with Attachments)

curl -X POST https://api.msndr.net/v1/email/campaigns \
     -H 'Authorization: Bearer $API_TOKEN'       \
     -F from_email=from@example.com              \
     -F subject='Mail with attachments'          \
     -F html='<h1>Hello world</h1>'              \
     -F attachments[]=@/path/to/file1            \
    -F attachments[]=@/path/to/file2
 

Uses POST method and /email/campaigns endpoint.

Successful Response Example

{
  "id":1,
  "from_email":"hello@world.com",
  "from_name":null,
  "html":"<h1>Hello World</h1>",
  "text":"Hello World",
  "state":"draft",
  "recipients_count":10,
  "purchase":{
    "enable":true,
    "subscribers":10,
    "credits":0,
    "deficit":0
  },
  "statistics":{
    "delivered":1,
    "bounced":0,
    "delivering":0,
    "uniq_open":0,
    "total_open": 0,
    "last_open_at": nil,
    "uniq_click":0,
    "total_click": 0,
    "last_click_at": nil,
    "unsubscription":0,
    "spam":0
  }
}


 

Request JSON Parameters:

 

Parameter Description Required
from_email Sender email address Yes
subject Email subject line Yes
from_name Sender name No
text Plain-text version of the email No
html HTML version of the email Yes
lists Array of recipient groups Yes

 

Recipient Group Parameters (lists)

 

Parameter Description Required
id Recipient group ID Yes

 

Response JSON Parameters

 

Attribute Description
id Campaign ID
from_email Sender email address
from_name Sender name
html HTML content of the email
text Plain-text content of the email
state Campaign status (default: draft)
recipients_count Number of recipients
purchase Billing information 
statistics Campaign statistics 

 

Possible state Values

 

Status Description
draft Draft
pending Under review
delayed Scheduled
sending In progress
canceled Canceled
stopped Paused
completed Finished
archived Archived

 

Billing Information (purchase)

 

Attribute Description
enable true (send allowed) / false (insufficient funds)
subscribers Number of subscribers to be charged
credits Number of credits to be charged
deficit Amount of insufficient funds

 

Statistics (statistics)

 

Attribute Description
delivered Number of delivered emails
bounced Number of bounced emails
delivering Number of emails in progress
uniq_open Unique opens
total_open Total opens
last_open_at Timestamp of last open
uniq_click Unique clicks
total_click Total clicks
last_click_at Timestamp of last click
unsubscription Number of unsubscribes
spam Number of "spam" reports

 

Sending a Created Campaign

HTTP Request Example

curl -X PATCH https://api.msndr.net/v1/email/campaigns/1/deliver \
     -H 'Content-Type: application/json'                    \
     -H 'Authorization: Bearer $API_TOKEN'

Uses PATCH method and /email/campaigns/:id/deliver endpoint, where :id is the campaign ID.

Successful Response Example

 

{
  "id":1,
  "from_email":"hello@world.com",
  "from_name":null,
  "html":"<h1>Hello World</h1>",
  "text":"Hello World",
  "state":"sending",
  "recipients_count":10,
  "purchase":{
    "enable":true,
    "subscribers":10,
    "credits":0,
    "deficit":0
  },
  "statistics":{
    "delivered":1,
    "bounced":0,
    "delivering":0,
    "uniq_open":0,
    "total_open": 0,
    "last_open_at": nil,
    "uniq_click":0,
    "total_click": 0,
    "last_click_at": nil,
    "unsubscription":0,
    "spam":0
  }
}


 

Response JSON Parameters

Attribute Description
id Campaign ID
from_email Sender email address
from_name Sender name
html HTML content of the email
text Plain-text content of the email
state Campaign status (default: draft)
recipients_count Number of recipients
purchase Billing information 
statistics Campaign statistics 

 

Possible state Values

 

Status Description
draft Draft
pending Under review
delayed Scheduled
sending In progress
canceled Canceled
stopped Paused
completed Finished
archived Archived

 

Billing Information (purchase)

 

Attribute Description
enable true (send allowed) / false (insufficient funds)
subscribers Number of subscribers to be charged
credits Number of credits to be charged
deficit Amount of insufficient funds

 

Statistics (statistics)

 

Attribute Description
delivered Number of delivered emails
bounced Number of bounced emails
delivering Number of emails in progress
uniq_open Unique opens
total_open Total opens
last_open_at Timestamp of last open
uniq_click Unique clicks
total_click Total clicks
last_click_at Timestamp of last click
unsubscription Number of unsubscribes
spam Number of "spam" reports

 

Retrieving Campaign List


 
HTTP Request Example

curl -X GET https://api.msndr.net/v1/email/campaigns \
     -H 'Content-Type: application/json'        \
     -H 'Authorization: Bearer $API_TOKEN'


 
Uses GET method and /email/campaigns endpoint
Supports pagination

Successful Response Example

{
  "total_count": 1,
  "total_pages": 1,
  "page_number": 1,
  "page_size": 25,
  "collection": [
    {
      "id": 1,
      "from_email": "test@example.com",
      "from_name": "Test",
      "html": "<p>test</p>",
      "text": "test",
      "state": "draft",
      "recipients_count": 10,
      "purchase": {
        "enable": true,
        "subscribers": 0,
        "credits": 10,
        "deficit": 0
      },
      "statistics":{
        "delivered":1,
        "bounced":0,
        "delivering":0,
        "uniq_open":0,
        "total_open": 0,
        "last_open_at": nil,
        "uniq_click":0,
        "total_click": 0,
        "last_click_at": nil,
        "unsubscription":0,
        "spam":0
      }
    }
  ]
}


The collection array contains campaign objects (same structure as in campaign creation).

Retrieving Campaign Details

HTTP Request Example

curl -X GET https://api.msndr.net/v1/email/campaigns/1 \
     -H 'Content-Type: application/json'               \
     -H 'Authorization: Bearer $API_TOKEN'
 


Uses GET method and /email/campaigns/:id endpoint
 
id is a campaign identifier
 

Successful Response Example

Same structure as campaign creation response.

{
  "id":1,
  "from_email":"hello@world.com",
  "from_name":null,
  "html":"<h1>Hello World</h1>",
  "text":"Hello World",
  "state":"sending",
  "recipients_count":10,
  "purchase":{
    "enable":true,
    "subscribers":10,
    "credits":0,
    "deficit":0
  },
  "statistics":{
    "delivered":1,
    "bounced":0,
    "delivering":0,
    "uniq_open":0,
    "total_open": 0,
    "last_open_at": nil,
    "uniq_click":0,
    "total_click": 0,
    "last_click_at": nil,
    "unsubscription":0,
    "spam":0
  }
}

 

 

Already using Cloud4U services?

Visit our website

Try for free

  • 57 Users Found This Useful
Was this answer helpful?

Related Articles

Отправка сообщений по SMTP

Базовый URL smtp.msndr.net Порт 25 или 587 Использование шифрования SSL\TLS не является...

Email Service API - General Information

Through the Email Newsletter Service's Application Programming Interface (API), you can send...

Restrictions on the Service to prevent spam

In order to prevent spam, there is a mechanism that limits the number of messages you can send....

Sending one email message

Sending an email message Example of json data for a request:   {...

Getting information about templates

You can retrieve the list of templates using the following HTTP request: curl -X GET...