Hypermedia Support
Thanks for the API! I really enjoy an API that is driven by hypermedia (see HATEOAS). Your API is so simple that it's a perfect setup for adding hypermedia to the responses to make the API almost self-documented.
1) You could add URLs to the messages for each inbox. This way, the client doesn't have to build the URLs.
"inbox":
{
"subdomain":"test-4ccef6e20ae998db",
"title":"test",
"messagescount":3,
"messagesurl":"http://mailtrap.io/api/v1/inboxes/test-4ccef6e20ae998db/messages?token=thekey"
}
2) You could add message URLs to your messages response.
{
"id":"b12f15b4-02b5-42b7-80c5-c530a4dd526c",
"from":"me@fromdomain.com",
"title":"SMTP e-mail test",
"createdat":"2013-02-17T03:30:21-06:00",
"recipients":[{"recipient":{"title":"test@todomain.com"}}],
"messageurl":"http://mailtrap.io/api/v1/inboxes/test-4ccef6e20ae998db/messages/b12f15b4-02b5-42b7-80c5-c530a4dd526c?token=thekey"
}
3) You could add "previous" and "next" links for the messages response. Instead of pages, you could specify an ID to make sure they get the next batch of messages.
Boom! The client doesn't need to build any URLs. If you want to keep that functionality, you could include a URI template as a field in your response.
Just a thought! Would make your API really discoverable.
Thanks so much for this service. I used it a ton while building a couple of apps recently.
For now Mailtrap 2 working on API, which we provide for customers – http://docs.mailtrap.apiary.io/