1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

Update for API v1

James Hillyerd
2016-02-25 19:29:17 -08:00
parent 15af543228
commit 4ff8d3f43e

@@ -4,7 +4,7 @@ List contents of mailbox.
### URI ### URI
`GET /mailbox/{name}` `GET /api/v1/mailbox/{name}`
### Params ### Params
@@ -13,16 +13,16 @@ List contents of mailbox.
### Output ### Output
A JSON array of message header maps, containing the following fields: A JSON array of message header maps, containing the following fields:
* `Mailbox` - name of the mailbox the message belongs to * `mailbox` - name of the mailbox the message belongs to
* `Id` - message identifier, will be unique for this mailbox, but not across mailboxes * `id` - message identifier, will be unique for this mailbox, but not across mailboxes
* `From` - message sender * `from` - message sender
* `Subject` - message subject line * `subject` - message subject line
* `Date` - date message was received (not the date specified by SMTP headers) in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. * `date` - date message was received (not the date specified by SMTP headers) in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
* `Size` - size of headers + message in bytes * `size` - size of headers + message in bytes
### Example ### Example
Request: `curl -i -H "Accept: application/json" http://localhost:9000/mailbox/swaks` Request: `curl -i -H "Accept: application/json" http://localhost:9000/api/v1/mailbox/swaks`
Response: (JSON reformatted for readability) Response: (JSON reformatted for readability)
@@ -34,35 +34,35 @@ Response: (JSON reformatted for readability)
[ [
{ {
"Mailbox":"swaks", "mailbox":"swaks",
"Id":"20131015T161202-0000", "id":"20131015T161202-0000",
"From":"jamehi03@server.com", "from":"jamehi03@server.com",
"Subject":"Swaks Plain Text", "subject":"Swaks Plain Text",
"Date":"2013-10-15T16:12:02.231532239-07:00", "date":"2013-10-15T16:12:02.231532239-07:00",
"Size":264 "size":264
}, },
{ {
"Mailbox":"swaks", "mailbox":"swaks",
"Id":"20131015T161202-0001", "id":"20131015T161202-0001",
"From":"jamehi03@server.com", "from":"jamehi03@server.com",
"Subject":"Swaks HTML", "subject":"Swaks HTML",
"Date":"2013-10-15T16:12:02.292145012-07:00", "date":"2013-10-15T16:12:02.292145012-07:00",
"Size":705 "size":705
}, },
{ {
"Mailbox":"swaks", "mailbox":"swaks",
"Id":"20131015T161202-0002", "id":"20131015T161202-0002",
"From":"jamehi03@server.com", "from":"jamehi03@server.com",
"Subject":"Swaks Attachment", "subject":"Swaks Attachment",
"Date":"2013-10-15T16:12:02.358027334-07:00", "date":"2013-10-15T16:12:02.358027334-07:00",
"Size":4802 "size":4802
}, },
{ {
"Mailbox":"swaks", "mailbox":"swaks",
"Id":"20131015T161202-0003", "id":"20131015T161202-0003",
"From":"jamehi03@server.com", "from":"jamehi03@server.com",
"Subject":"Test of ȇɲʢȯȡɪɴʛ", "subject":"Test of ȇɲʢȯȡɪɴʛ",
"Date":"2013-10-15T16:12:02.424206527-07:00", "date":"2013-10-15T16:12:02.424206527-07:00",
"Size":2946 "size":2946
} }
] ]