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 GET /api/v1/email-addresses/bar@mail.mapil.co/messages?offset=23&limit=1 { "offset": 23, "limit": 1, "count": 68, "results": [ { "html": "<html><head></head><body>Hello<br>Foo</body>body></html>", "text": "Hello\nFoo", "headers": { "received": { "0": "by mail.foo.com with SMTP id gy3so90375699igb.0 for <bar@mail.mapil.co>; 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 <foo@gmail.com>", "x-mailer": "Mailcilient 1.0", "mime-version": "1.0", "date": "Mon, 18 Apr 2016 16:38:35 -0400", "message-id": "<CADi8pJCZ3=HHLjH+1oC_ZVz1C2BUFj2beGd-5VsQaSK_PEd=vQ@mail.gmail.com>", "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": "<html><head></head><body>Hello<br>Foo</body>body></html>", "text": "Hello\nFoo", "headers": { "received": { "0": "by mail.foo.com with SMTP id gy3so90375699igb.0 for <bar@mail.mapil.co>; 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 <foo@gmail.com>", "x-mailer": "Mailcilient 1.0", "mime-version": "1.0", "date": "Mon, 18 Apr 2016 16:38:35 -0400", "message-id": "<CADi8pJCZ3=HHLjH+1oC_ZVz1C2BUFj2beGd-5VsQaSK_PEd=vQ@mail.gmail.com>", "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.