I suggest you ...

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",
"messages_count":3,
"messages_url":"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",
"created_at":"2013-02-17T03:30:21-06:00",
"recipients":[{"recipient":{"title":"<test@todomain.com>"}}],
"message_url":"http://mailtrap.io/api/v1/inboxes/test-4ccef6e20ae998db/messages/b12f15b4-02b5-42b7-80c5-c530a4dd526c?token=thekey&quot;
}

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.

4 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
Stephen Mizell shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base