API Technical Writing: JSON example
Creating a JSON file
This is an example of a JSON file I created using Notepad++ that captures multi-day forecast data.
Documenting JSON Files
JSON Response
One way to document a JSON file is with a description and table. Below I used Microsoft Word to write a short description of what the JSON response represents. Then, I created a table to document the JSON response details. Note, that I used the indentation method in this table.
JSON Request
The difference in the documentation for JSON responses and requests is that the table for JSON requests includes a column called Required. In the following example, I am working with an API for an online calendar. A JSON request is sent to create a new meeting. The JSON looks like this:
I used Microsoft Word to document the JSON request. A one-sentence description states what the table represents. The table includes the column labeled, Required.