MailHog/docs/APIv1.md

53 lines
1.1 KiB
Markdown
Raw Normal View History

2014-12-24 17:57:47 +00:00
MailHog API v1
==============
2014-04-27 19:52:46 +00:00
The v1 API is a RESTful HTTP JSON API.
### GET /api/v1/events
2014-04-28 00:58:45 +00:00
Streams new messages using EventSource and chunked encoding
### GET /api/v1/messages
2014-04-27 19:52:46 +00:00
Lists all messages excluding message content
### DELETE /api/v1/messages
2014-04-27 19:52:46 +00:00
Deletes all messages
Returns a ```200``` response code if message deletion was successful.
### GET /api/v1/messages/{ message_id }
2014-04-27 19:52:46 +00:00
Returns an individual message including message content
### DELETE /api/v1/messages/{ message_id }
2014-04-27 19:52:46 +00:00
Delete an individual message
Returns a ```200``` response code if message deletion was successful.
### GET /api/v1/messages/{ message_id }/download
2014-04-27 19:52:46 +00:00
Download the complete message
### GET /api/v1/messages/{ message_id }/mime/part/{ part_index }/download
2014-04-27 19:52:46 +00:00
Download a MIME part
### POST /api/v1/messages/{ message_id }/release
2014-04-27 19:52:46 +00:00
Release the message to an SMTP server
Send a JSON body specifying the recipient, SMTP hostname and port number:
```json
{
"Host": "mail.example.com",
"Post": "25",
"Email": "someone@example.com"
}
```
Returns a ```200``` response code if message delivery was successful.