mapil.co api

Below you'll find a list of REST API resources. All requests should me made to https://mapil.co.

Authenticate using HTTP basic authentication, with the API token as the username and API secret as the password.

If you dont' have an account yet, you'll need to sign up before you can use the API

Error Example (HTTP status code 400)

{
    "message": "That email address is already in use"
}

/api/v1/email-addresses

GET
List all email addresses on your account.
{
    "offset": 0,
    "limit": 2,
    "total_records": 12,
    "results": [
        "me@mail.mapil.co",
        "you@mail.mapil.co"
    ]
}

/api/v1/email-addresses/{address}

POST
Create this email address. Addresses must be alphanumeric and end with the @mail.mapil.co domain
GET /api/v1/email-addresses/foo@mail.mapil.co

{
    "message": "foo@mail.mapil.co created"
}
DELETE
Delete this email address
DELETE /api/v1/email-addresses/foo@mail.mapil.co
{
    "message": "foo@mail.mapil.co deleted"
}

/api/v1/email-addresses/{address}/messages

GET
List all messages sent to this address. You may specify offset and limit as GET variables. 'after' and 'before' may be used together or independently (but at least one must be specified). The date format should be URL-encoded ISO-8601.
GET /api/v1/email-addresses/bar@mail.mapil.co/messages?offset=23&limit=1&after=2010-01-28T12:00:00Z

{
  "offset": 23,
  "limit": 1,
  "count": 68,
  "results": [
        {
          "html": "Hello
Foobody>", "text": "Hello\nFoo", "headers": { "received": { "0": "by mail.foo.com with SMTP id gy3so90375699igb.0 for ; Mon, 18 Apr 2016 20:50:17 -0700 (PDT)", "1": "from 1058052472880 named unknown by mail.bar.com with HTTPREST; Mon, 18 Apr 2016 16:38:35 -0400" }, "from": "John Doe ", "x-mailer": "Mailcilient 1.0", "mime-version": "1.0", "date": "Mon, 18 Apr 2016 16:38:35 -0400", "message-id": "", "subject": "QA Test Email Subject", "to": "bar@mail.mapil.co", "content-type": "multipart/alternative; boundary=001a11c1e7ea47a0140530c858c4" }, "subject": "QA Test Email Subject", "messageId": "CADi8pJCZ3=HHLjH+1oC_ZVxoC2BUFj2beGd-5VsQaSK_PEd=vQ@mail.gmail.com", "priority": "normal", "from": { "0": { "address": "foo@gmail.com", "name": "John Doe" } }, "to": { "0": { "address": "bar@mail.mapil.co", "name": "QA Test 1" } }, "id": "5715aaf9cfd845e640625158" } ] }

/api/v1/email-addresses/{address}/messages/{message_id}

GET
Get a single message by address and ID in JSON format
GET /api/v1/email-addresses/bar@mail.mapil.co/messages/5715aaf9cfd845e640625158

{
  "html": "Hello
Foobody>", "text": "Hello\nFoo", "headers": { "received": { "0": "by mail.foo.com with SMTP id gy3so90375699igb.0 for ; Mon, 18 Apr 2016 20:50:17 -0700 (PDT)", "1": "from 1058052472880 named unknown by mail.bar.com with HTTPREST; Mon, 18 Apr 2016 16:38:35 -0400" }, "from": "John Doe ", "x-mailer": "Mailcilient 1.0", "mime-version": "1.0", "date": "Mon, 18 Apr 2016 16:38:35 -0400", "message-id": "", "subject": "QA Test Email Subject", "to": "bar@mail.mapil.co", "content-type": "multipart/alternative; boundary=001a11c1e7ea47a0140530c858c4" }, "subject": "QA Test Email Subject", "messageId": "CADi8pJCZ3=HHLjH+1oC_ZVxoC2BUFj2beGd-5VsQaSK_PEd=vQ@mail.gmail.com", "priority": "normal", "from": { "0": { "address": "foo@gmail.com", "name": "John Doe" } }, "to": { "0": { "address": "bar@mail.mapil.co", "name": "QA Test 1" } }, "id": "5715aaf9cfd845e640625158" }

/api/v1/email-addresses/{address}/messages/{message_id}/html

GET
The the HTML part of the message content for the specified message. Delivered content-type will be text/html. Should be suitable for browser rendering and visual inspection

/api/v1/email-addresses/{address}/messages/{message_id}/text

GET
The the plain text part of the message content for the specified message. Delivered content-type will be text/plain. Should be suitable for easily validating message content.

/api/v1/email-addresses/{address}/messages/{message_id}

DELETE
Delete a single message by address and ID
DELETE /api/v1/email-addresses/bar@mail.mapil.co/messages/5715aaf9cfd845e640625158

{

}

/api/v1/email-addresses/{address}/messages

DELETE
Delete messages by date. 'after' and 'before' may be used together or independently (but at least one must be specified). The date format should be URL-encoded ISO-8601.
DELETE /api/v1/email-addresses/bar@mail.mapil.co/messages?before=2020-01-28T12:00:00Z

{
    "message": "23 messages deleted"
}