GET masters/{id}

Overview

The master is an amalgamation of several differnent components that make up a message that can be personalized and targeted to a specific group of subscribers. It includes the delivery information, the schedule for delivery, the targeting, the message envelope, content, and attachments.

Resource URI

 https://api.yesmail.com/v2/masters/{id}

Call Description

The GET /v2/masters/{id} call returns the envelope, delivery, schedule, targeting, html content, text content, urls, and attachements for a specific master.

Delivery Parameters

Parameter Required Description
maxRecipients

Optional

default=no limit

Maximum number of recipients to send from this master. Once it mails to this number, even if there are more eligible records, it will not mail anymore, unless you increase this number again. This is true for all recurrences of the message.

multiDeliveries

Optional, default=false

Allows for multiple deliveries of the master to the same recipient. Disables seed lists if set to true.

obeyCompanyLimits

Optional, default=true

Controls whether company delivery limits of 3 messages per day per customer are obeyed for this master. Usually set to true for marketing messages and false for transactional messages.

obeyUserLimits

Optional, default=true

Controls whether the email counts against the per-user-limit. Transactional emails are typically set to false.

priority Optional, default=1 Integer value between 1 (default) and 100. Indicates the priority compared to other masters scheduled at the same time.
rate Optional sets the maximum number of messages to deliver per hour.
type Optional, default=auto
  • auto - Will send the HTML version to recipients who have requested to receive HTML, and plain text to those who have requested to received Plain Text. If no preference is stated, then a multipart-MIME with both versions is sent. Both HTML and text body content must be defined.
  • normal - Will send the HTML version to recipients who have requested to receive HTML, and plain text to those who have requested to received Plain Text. If no preference is stated, then the plain text is sent. If there is no HTML version, then all recipients will receive the plain text version regardless of the user preference. Only text body content is required.
  • both - Will send a multipart-MIME with both versions regardless of the user preference. Both HTML and text body content must be defined.

HTTP Return Codes

Code

Description

200 OK

The request has succeeded.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.

404 Not Found

The server has not found anything matching the request resource.   For instance, the “id” does not exist.

Response Payload: 
{
  "id": "123456",
  "lastUpdate": "2014-02-28T16:08:20Z",
  "name": "0912_Fall Campaign A",
  "description": "2014 Fall campaign for segment A",
  "subscription": "Marketing",
  "status": "enabled",
  "campaign": "Existing Label",
  "keywords": [
    "premium",
    "fall",
    "promotion"
  ],
  "seedLists": [
    "optional",
    "seed",
    "lists"
  ],
  "delivery": {
    "lastSend": "2014-03-10T10:02:10Z",
    "maxRecipients": 3000,
    "multiDeliveries": false,
    "obeyCompanyLimits": true,
    "obeyUserLimits": true,
    "priority": 3,
    "rate": 2000,
    "type": "auto"
  },
  "schedule": {
    "frequency": "once",
    "preCompileStart": "2014-03-10T08:00:00Z",
    "start": "2014-03-10T10:00:00Z"
  },
  "template": {
    "encoding": "UTF-8",
    "from": [
      {
        "email": "special@clothes.com",
        "name": "Major Clothing brand - `salescontact`"
      }
    ],
    "replyTo": {
      "email": "reply-to@clothing.com",
      "name": "Reply T. Me"
    },
    "sender": {
      "email": "sender@clothing.com",
      "name": "Sender Name"
    },
    "subject": [ "Fall is here. Get cozy with wool." ],
    "body": [
      {
        "html": "<!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\"\r\n\t\"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\">\r\n<html lang=\"en\">\r\n<head></head><body>JSON-encoded HTML content<\/body>\r\n<\/html>",
        "text": "JSON-encoded text content",
        "attachments": [
          {
            "name": "unique-name",
            "type": "image/gif",
            "base64": "YmFzZSA2NCBlbmNvZGVkIGltYWdlIG9yIGZpbGU="
          }
        ],
        "links": [
          {
            "uri": "http://client.domain.com/full/path",
            "position": 1,
            "description": "Optional description of link",
            "type": "html",
            "tracking": true,
            "trackingUri": "http://p0.com/abcdef"
          }
        ]
      }
    ]
  },
  "target": {
        "segments": [
            {
                "subscription": {
                    "status": "subscribed"
                }
            },
            {
                "group": {
                    "segments": [
                        {
                            "attribute": {
                                "name": "gender",
                                "values": [
                                    "'female'"
                                ],
                                "nextOp": "and"
                            }
                        },
                        {
                            "attribute": {
                                "name": "leaddate_Range",
                                "values": [
                                    "Today"
                                ]
                            }
                        }
                    ],
                    "nextOp": "and"
                }
            },
            {
                "group": {
                    "segments": [
                        {
                            "attribute": {
                                "name": "LeadRange",
                                "values": [
                                    "'Within last month'",
                                    "'1 to 2 months'",
                                    "'2 to 3.5 months'"
                                ],
                                "nextOp": "or"
                            }
                        },
                        {
                            "attribute": {
                                "name": "Has Opened in X days",
                                "values": [
                                    "120"
                                ],
                                "nextOp": "or"
                            }
                        },
                        {
                            "attribute": {
                                "name": "create date",
                                "values": [
                                    "90"
                                ],
                                "nextOp": "or"
                            }
                        },
                        {
                            "action": {
                                "type": "received",
                                "masterIds": [
                                    {
                                        "masterId": "1131191",
                                        "lessThanDays": 7
                                    }
                                ]
                            }
                        }
                    ],
                    "negate": true,
                    "nextOp": "and"
                }
            },
            {
                "group": {
                    "segments": [
                        {
                            "attribute": {
                                "name": "LeadRange",
                                "values": [
                                    "'10 to 13 months'"
                                ],
                                "nextOp": "and"
                            }
                        },
                        {
                            "attribute": {
                                "name": "Has Opened in X days",
                                "values": [
                                    "400"
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }
}