-
Charlie Root committed 2 years ago
-
-
-
-
1 + [Back to REST API](https://docs.crash.fyi) 2 + 3 + List contents of mailbox. 4 + 5 + ### URI 6 + 7 + `GET /api/v1/mailbox/{name}` 8 + 9 + ### Params 10 + 11 + * `name` - name of the mailbox to list the contents of 12 + 13 + ### Output 14 + 15 + A JSON array of message header maps, containing the following fields: 16 + * `mailbox` - name of the mailbox the message belongs to 17 + * `id` - message identifier, will be unique for this mailbox, but not across mailboxes 18 + * `from` - message sender 19 + * `subject` - message subject line 20 + * `date` - date message was received (not the date specified by SMTP headers) in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. 21 + * `size` - size of headers + message in bytes 22 + 23 + ### Example 24 + 25 + Request: `curl -i -H "Accept: application/json" https://crah.fyi/api/v1/mailbox/swaks` 26 + 27 + Response: (JSON reformatted for readability) 28 + 29 + HTTP/1.1 200 OK 30 + Content-Type: application/json; charset=utf-8 31 + Expires: -1 32 + Content-Length: 686 33 + Date: Tue, 15 Oct 2013 23:54:36 GMT 34 + 35 + [ 36 + { 37 + "mailbox":"swaks", 38 + "id":"20131015T161202-0000", 39 + "from":"[email protected]", 40 + "subject":"Swaks Plain Text", 41 + "date":"2013-10-15T16:12:02.231532239-07:00", 42 + "size":264 43 + }, 44 + { 45 + "mailbox":"swaks", 46 + "id":"20131015T161202-0001", 47 + "from":"[email protected]", 48 + "subject":"Swaks HTML", 49 + "date":"2013-10-15T16:12:02.292145012-07:00", 50 + "size":705 51 + }, 52 + { 53 + "mailbox":"swaks", 54 + "id":"20131015T161202-0002", 55 + "from":"[email protected]", 56 + "subject":"Swaks Attachment", 57 + "date":"2013-10-15T16:12:02.358027334-07:00", 58 + "size":4802 59 + }, 60 + { 61 + "mailbox":"swaks", 62 + "id":"20131015T161202-0003", 63 + "from":"[email protected]", 64 + "subject":"Test of ȇɲʢȯȡɪɴʛ", 65 + "date":"2013-10-15T16:12:02.424206527-07:00", 66 + "size":2946 67 + } 68 + ] 69 + -
1 + [Back to REST API](https://docs.crash.fyi) 2 + 3 + Retrieve message source 4 + 5 + ### URI 6 + 7 + `GET /api/v1/mailbox/{name}/{id}/source` 8 + 9 + ### Params 10 + 11 + * `name` - name of the mailbox the message belongs to 12 + * `id` - identifier of the message to retrieve 13 + 14 + ### Output 15 + 16 + Plain text dump of the message headers and body in SMTP format. 17 + 18 + ### Example 19 + 20 + Request: `curl -i -H "Accept: application/json" https://crash.fyi/api/v1/mailbox/swaks/20131015T161202-0000/source` 21 + 22 + Response: 23 + 24 + HTTP/1.1 200 OK 25 + Content-Type: text/plain 26 + Content-Length: 264 27 + Date: Tue, 15 Oct 2013 23:52:09 GMT 28 + 29 + Date: Tue, 15 Oct 2013 16:12:02 -0700 30 + To: [email protected] 31 + From: [email protected] 32 + Subject: Swaks Plain Text 33 + X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/ 34 + 35 + This is a test mailing. 36 + 37 + This should be clickable: http://google.com/ 38 + -
1 + [Back to REST API](https://docs.crash.fyi) 2 + 3 + Retrieve message body 4 + 5 + ### URI 6 + 7 + `GET /api/v1/mailbox/{name}/{id}` 8 + 9 + ### Params 10 + 11 + * `name` - name of the mailbox the message belongs to 12 + * `id` - identifier of the message to retrieve 13 + 14 + ### Output 15 + 16 + * The Inbucket version of the message headers (same as returned by [GET /api/v1/mailbox/{name}](https://docs.crash.fyi/REST-GET-mailbox)) 17 + * The parsed SMTP headers (not converted to UTF-8) 18 + * The decoded Text and HTML portions of the MIME body of the email 19 + * A list of attachments (coming in 1.2.0) 20 + 21 + ### Example 22 + 23 + Request: `curl -i -H "Accept: application/json" https://crash.fyi/api/v1/mailbox/swaks/20131016T164638-0001` 24 + 25 + Response: (JSON reformatted for readability) 26 + 27 + HTTP/1.1 200 OK 28 + Content-Type: application/json; charset=utf-8 29 + Expires: -1 30 + Content-Length: 810 31 + Date: Thu, 17 Oct 2013 21:51:59 GMT 32 + 33 + { 34 + "mailbox": "swaks", 35 + "id": "20131016T164638-0001", 36 + "from": "[email protected]", 37 + "subject": "Swaks HTML", 38 + "date": "2013-10-16T16:46:38.646370568-07:00", 39 + "size": 705, 40 + "body": { 41 + "text": "This is a test mailing.\r\n\r\nThis should be clickable: http://google.com/\r\n", 42 + "html": "<html>\n<body>\n<p>This is a test mailing <b>in HTML</b></p>\n\n<p>This should be clickable: [...]" 43 + }, 44 + "header": { 45 + "Content-Type": [ 46 + "multipart/alternative; boundary=\"----=_MIME_BOUNDARY_000_62717\"" 47 + ], 48 + "Date": [ 49 + "Wed, 16 Oct 2013 16:46:38 -0700" 50 + ], 51 + "From": [ 52 + "[email protected]" 53 + ], 54 + "Mime-Version": [ 55 + "1.0" 56 + ], 57 + "Subject": [ 58 + "Swaks HTML" 59 + ], 60 + "To": [ 61 + "[email protected]" 62 + ] 63 + }, 64 + "attachments": [ 65 + { 66 + "filename": "favicon.png", 67 + "content-type": "image/png", 68 + "download-link": "https://crash.fyi/mailbox/dattach/swaks/20131016T164638-0001/0/favicon.png", 69 + "view-link": "https://crash.fyi/mailbox/vattach/swaks/20131016T164638-0001/0/favicon.png", 70 + "md5": "a72a7565b6b6587ac15fc35746307d0e" 71 + } 72 + ] 73 + } 74 + -