Over a million developers have joined DZone.

API Documentation with IODocs

DZone's Guide to

API Documentation with IODocs

· Integration Zone
Free Resource

The Integration Zone is brought to you in partnership with Cloud Elements.  What’s below the surface of an API integration? Download The Definitive Guide to API Integrations to start building an API strategy.

I write a lot of APIs, and I also preach that your API isn't finished until it has excellent documentation. Which is great, but that means I therefore have to lead by example and document my APIs. Enter iodocs from the talented folks at Mashery.

Iodocs is a node.js application (which is fun for a PHP developer. Most developers write a bit of JS, but this one hasn't). You describe your API and all its methods in JSON, and then iodocs presents an interface for you to enter API keys, add parameters to each request and press the "try it!" button. This makes your API call and shows you the results on screen, which seems like a great way to demonstrate what all the various parameters do!

iodocs screenshot

The setup and installation was pretty straightforward - node.js apps all have a packages.json file which states their dependencies and the npm package manager knows what to do. So you just grab the app from github and npm install and it pretty much worked. I had a problem with an older version of node.js (I had 0.8.2, when I upgraded to 0.8.9 it was all fine) but I figured it out.

I like the iodocs as a way of showing to the user what you can do with the API before they have to settle down and write some code. For example, on joind.in, you can request lists of events using various criteria, and iodocs presents form fields for that:

iodocs screenshot

If you want to have a play, I deployed this to heroku (blog post coming on that too, if you like) so you're welcome to click around: http://lornajane-iodocs.herokuapp.com/joindinv2. There are descriptions of other APIs too, and I've seen a few sites using this (which is where I came across it). The big stumbling block at the moment is the lack of OAuth2 support (as both joind.in and github use this, I'd quite like it!) but the mashery devs have promised to get back to me on that so watch this space ...

The State of API Integration Report provides data from the Cloud Elements platform and will help all developers navigate the recent explosion of APIs and the implications of API integrations to work more efficiently in 2017 and beyond.


Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}