Product

Mailgun Hack Day: Making our API documentation smarter

Each month our team has the opportunity to hack on whatever it is we want to hack on. A fun way to learn something new, collaborate with different team members or just tidy up something that has been bugging us.

PUBLISHED ON

PUBLISHED ON

Each month our team has the opportunity to hack on whatever it is we want to hack on. A fun way to learn something new, collaborate with different team members or just tidy up something that has been bugging us.

For January’s hack day, a few of us (Anton, Jesse and myself) set out to make some improvements to our API Docs.

The problem

Our API is well documented and has a good range of code samples for all the major programming languages. However, there are a couple of things we noticed about the workflow.

To try an API request, a developer would typically:

  1. Copy a code sample to a text editor

  2. Edit some parameters (e.g. sender, recipient, body text)

  3. Go to their Mailgun Control Panel to copy their API key

  4. Go back to the code editor and paste the key

  5. Copy that sample to their command line and execute

For quickly exploring a new service or testing out a new endpoint, this seems like a couple of steps too many.

The solution

Part 1: Your Mailgun settings injected into code samples

Now the code samples we show you are a bit smarter. If you’re logged in to Mailgun, we will inject your API key and some smart defaults for you.

Therefore it’s just a matter of copy/pasting the code samples into your command line, executing, and they should work off the bat.

A GIF showing the API key

Part 2: Code samples are editable in the browser

We’ve also made the code samples editable. Using Ace editor, clicking on any code sample will turn it into a small in-browser text editor that you can make changes to.

An editable code sample provided by Mailgun

Conclusion

API docs are instrumental to the user experience of a developer service. With the above changes shipped to production, we hope that trying out our API should be a lot easier for new developers exploring our service and existing developers that want to test or troubleshoot different API endpoints.

Check out the improvements to the Mailgun developer docs.

Sign Up

It's easy to get started. And it's free.

See what you can accomplish with the world’s best email delivery platform.

Related readings

How to improve holiday supply chain communication with email

This year, shoppers aren’t the only ones worried about orders arriving on time for the holidays. The 2023 holiday shopping season is packed with global supply chain...

Read more

What is a RESTful API, how it works, advantages, and examples

RESTful APIs are the most commonly used APIs in the world of web services. They use...

Read more

Email’s Not Dead Season 3 is finally here

The wait is finally over - Email’s Not Dead is back!...

Read more

Popular posts

Email inbox.

Build Laravel 10 email authentication with Mailgun and Digital Ocean

When it was first released, Laravel version 5.7 added a new capability to verify user’s emails. If you’ve ever run php artisan make:auth within a Laravel app you’ll know the...

Read more

Mailgun statistics.

Sending email using the Mailgun PHP API

It’s been a while since the Mailgun PHP SDK came around, and we’ve seen lots of changes: new functionalities, new integrations built on top, new API endpoints…yet the core of PHP...

Read more

Statistics on deliverability.

Here’s everything you need to know about DNS blocklists

The word “blocklist” can almost seem like something out of a movie – a little dramatic, silly, and a little unreal. Unfortunately, in the real world, blocklists are definitely something you...

Read more

See what you can accomplish with the world's best email delivery platform. It's easy to get started.Let's get sending
CTA icon