Tips for documenting APIs

Tips for documenting APIs

First, let’s start with a funny example; “If APIs are eating the world, recipe as API documentation, and we as Chefs, always try to offer wonderful dishes to the customers”. I hope now you got my point. As technical writers, our job is more or less similar to chefs, they always try to provide us best food.? Even we work hard to write the best API documentation, which should be easy to read, informative, and succinct. With the help of our API documentation, developers can cook up something wonderful.

Today in this article, I am going to explain easy tips to write the best API documentation;

1. First help yourself when you code:

Always remember one thing; a good design decision always makes it easy to document your APIs. You should be consistent and stick with existing standards to document the items only once.

For example, if you are working with HTTP codes, try not to bend the meanings (avoid giving your meaning), and adding new codes (that’s not our job; let the developers do their job). Try to provide a standard description, like 200 means “OK”, and 404 means “NOT FOUND”.

2. Document from a user’s perspective:

Before start documenting your API, try to analyze the type of audience, and I think this is one of the crucial parts. For example, you are documenting a payment process, users think in terms of refunds, charges, credit cards, and savings. So make sure that you structure your document in that way.

3. Don’t put URI front and center:

Adding URI is the important thing in your API documentation. As we know that URI provides a mapping between the logic and the HTTP clients. Swagger is a popular and widely used API tool; the major drawback of using Swagger is that it generates documents that are URI-centric.

4. Try to write in writing tool:

?Write the document as much as possible with the help of tools, which are mainly designed for writing purposes only. In that case, I would like to give an example of ASCII DOCTOR, a plain text writing tool for authoring the documentation, e-books, newsletter, blogs, and articles. ASCII DOCTOR comes up with various plugins, which can be used in documentation as per your requirements.

5. Generates the examples automatically and combine them with your explanation:

When you check Spring REST docs, they help users to get the complete information with minimum effort. The Spring REST docs are the combination of handwritten (which is written using ASCII Doctor Tool) and auto-generated snippets.

6. Always plan for the future:

?Make sure that your great ideas get used by developers; good API documentation should always be a part of your effort. Don’t forget “APIs make it possible for people with a great idea to provide a credible service with minimum effort and investment”.

?


要查看或添加评论,请登录

Kavya Gowda的更多文章

  • Nvidia: A Remarkable Journey to a $1 Trillion Market Cap Fueled by AI Dominance

    Nvidia: A Remarkable Journey to a $1 Trillion Market Cap Fueled by AI Dominance

    NVIDIA Corporation, a leading technology company specializing in graphics processing units (GPUs) and artificial…

  • How to become a Cyber Security Engineer?

    How to become a Cyber Security Engineer?

    In today’s world, we need data to perform various day-to-day activities. So we consume data through the internet or…

    2 条评论
  • Terraform- a popular open-source infrastructure tool

    Terraform- a popular open-source infrastructure tool

    Today I am going to discuss a few very important things about Terraform. Some of you might have familiar with this tool.

  • Bitbucket: a developer's guide

    Bitbucket: a developer's guide

    Today I am going to start with one more repository platform, a "Bitbucket". Let's get started; Introduction to…

  • GitHub: a developer's guide

    GitHub: a developer's guide

    In the previous article, I have explained GitLab, its features, advantages, and disadvantages of the tool. I think…

  • GitLab: a developer's guide

    GitLab: a developer's guide

    I am developing this article to help a few of our readers or developers who are looking out to know the differences…

  • API documentation example: what does it look like?

    API documentation example: what does it look like?

    In my previous articles, I have explained what is API documentation and the important things required to create…

  • Essentials of API Documentation

    Essentials of API Documentation

    When you hear the term “API”, you will start thinking about why these APIs are in so much demand? This is because; APIs…

  • Differences between DDLC and SDLC

    Differences between DDLC and SDLC

    If you are a technical writer, then it’s very important to know the differences between these two life cycles (DDLC and…

    2 条评论
  • JIRA project types and how to create the first-ever JIRA project?

    JIRA project types and how to create the first-ever JIRA project?

    In the previous article, I have explained what is JIRA, How do JIRA works, its benefits, and its core features (Click…

社区洞察

其他会员也浏览了