| I'm writing documentation for a public (REST) API and wonder which layout is preferred by developers. For example, Stripe uses a three-column layout: a navigation pane, a column to describe the API, a column with examples and error codes (see [1]). In contrast, Mailgun uses two columns: a navigation pane and a colum including the API description and examples (see [2]). Both layouts seem popular, and I'd like to better understand what's making you prefer one over the other. I'm talking about reference documentation, assuming there's also a separate user guide. Personally, I find the three column layout harder to read: the example pane often wastes a lot of space and squeezes the actual documentation in the middle. On the other hand, I see more and more sites (and tools [3]) using that layout, so that's probably just me? Thanks for your thoughts! [1] https://stripe.com/docs/api [2] https://documentation.mailgun.com/en/latest/api-sending.html [3] https://github.com/lord/slate (edit: simplified the layout descriptions) |
My suggestions would be the following: 1) Make sure the API docs are up to date! 2) For each API route, mention all possible fields as well as their type and maybe a short description of what they do if it's not obvious. 3) If you're providing wrappers, show an example of how to use them with each endpoint.
If you make sure you're doing 1 & 2, your documentation will be helpful and easy to use. I work for an API company and we've made sure that our API is always up-to-date by automating it. If we ever add, remove or rename a certain parameter in a new API version, the documentation will reflect those changes as soon as they go live without us have to update the documentation manually. This has proven to be highly effective as it guarantees our docs are always right and up-to-date.