Application Programming Interface or an API is the behind the scene hero that allows two applications to connect. Using APIs, two applications can send requests and receive responses. For example, when you access facebook, or book a flight, or order your food via a service, APIs work to maintain the connectivity. Consider an example of visiting a restaurant. You would look at the menu and decide your order and the chef in the kitchen will prepare your order. However, a critical element that is missing here is the waiter who will take your request, inform the chef what to do, and bring your order to your table. The role of waiter is what an API does. Simple!
Now that we have understood what an API does, let us look at what is API documentation. API documentation is a technical document that helps the engineers or developers understand the working of the API in a simple manner. API documentation is provides instructions on how to use an integrate the APIs. These documents provide reference information on possibilities and limitations with the APIs. Since these are technical documents to use APIs that work at the backend, the audience is typically engineers or developers.
Can you use APIs without the documentation? Yes, you can! However, the adoption of API becomes rather easy with clear technical content. The documents can guide the user how to effectively use the APIs and integrate, as needed, with other APIs to get the desired result.
Following example provides basic API document layout:
Writing API documentation involves writing technical information and examples. With technical understanding of the code, you will be able to deliver clear documentation that meets audience expectations (a developer in this case).
Learn the concept yourself first or rather write with an intent to use the information yourself. When you understand the backend working and programing, you will be able to write in the simplest possible way. Your concept clarity will reflect in your writing. If you do not understand a concept you cannot teach it to others.
Make sure that you include all the necessary examples and code snippets. The target audience here is developers and programmers. Nothing is more useful to them than actual examples or code pieces that they can try to test various use cases. If you keep the focus on meeting your audience expectations, you will be able to produce quality API content.