Read messages
When you read messages, it is always in an email context. A message cannot exist without an email and therefore messages are placed below emails hierarchically.
Read a collection of messages
Endpoint: GET emails/{email}/messages
This endpoint will provide you with the documents for all messages in an email with their latest delivery report as the response data type below. Arranged chronologically by date of creation.
Reading a single message
Endpoint: GET emails/{email}/messages/{messageId}
This endpoint will provide you with the document for a single message with a complete history of delivery reports as the data type below.
Response data type
In addition to reading the email in its entirety, you can also view specific messages.
{ "id": "5bc86b6e85c7209830f96937", "emailId": "5bc86b6e85c7209830f96936", "owner": "ip1-XXXXX", "senderName": "Sample Corp", "senderAddress": "info@example.com", "subject" ": "Sample Email", "recipientName": "Head Office", "recipientAddress": "info@othercorp.com", "body": "This is a sample email in special text to Head Office", "type": "Text", "priority": 1, "price": 0.01, "currency": "eur", "modified": "2018-10-23T17:43:19Z", "templated": true, "statuses": [ { "created": "2018-10-23T17:43:21Z", "code": "201", "duration": 0 } ] }
id
A unique ID for the specific message.
emailId
An ID for all messages sent in the same call as this message.
owner
Account ID of the account that owns the email (eg you).
senderName
The name associated with the sender address. Can be anything, max 64 characters.
senderAddress
The sender email address from which the email will be sent. Any valid email address for a registered and verified domain.
subject
The email subject line. Max 78 characters.
recipientName
The name associated with the email address of the recipient of the message.
recipientAddress
The email address of the recipient of the message.
body
The email content. Plain text or HTML depending on the type used.
type
The type of email to send that determines how the body parameter is used, descriptions below.
Value (type) | Description |
---|---|
Text | Unformatted email, the body is the entire email content |
Hybrid | Plain text entered into our ready-made HTML template as a text box, the body is the text in the box |
HTML | Full HTML email, the body is a full HTML page |
priority
If it is very important to you that your messages arrive quickly and are not obstructed by our other messages in the queue, you can prioritize higher. However, prioritizing a higher value will increase the price by 10 öre (0.01 EUR). Priority 1 is the default and is the lowest priority available, and priority 2 is the highest priority available. If specified, 1 and 2 are the only valid values.
price
The price for the entire message.
currency
Which currency the given price uses.
modified
When the email was last updated.
templated
Whether Tempalting was used or not.
statuses
An Array containing status updates
- statuses[].created
- when the status was added
- statuses[].code
- The specific status code. More status codes may be added in the future.
- statuses[].duration
- Tells whether this is the last status update or if there may be more status updates to come
If you call a collection of messages, only the most recent status will be given. However, when you request a specific message, the entire status history will be provided. For more information on our message status codes, see our Status Codes section.