From the course: Learn API Documentation with JSON and XML
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Documenting JSON requests
From the course: Learn API Documentation with JSON and XML
Documenting JSON requests
- [Instructor] Now that I've covered JSON Responses let's talk about how to document JSON Requests. The table for JSON Requests is identical to that for responses, except that you need a column called Required. When you send a request, not all elements are necessarily required. If an element is optional, the developer needs to know that. In the Required column, I recommend putting either Required or Optional. Often these tables will have Yes or No, or True or False, but if it's a large table, then you may be making the developer scroll up to the top to remember if the column is required or optional. If you use Required or Optional in the table cells themselves, then it's immediately apparent what it means. Let's imagine that we were documenting an API that allows users to add comments to a posting. The JSON might look like this. There is a comment object, which contains key value pairs for a user ID that says who the user is that's making the comment, a discussion ID that says which…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
JSON basics2m 45s
-
(Locked)
JSON examples6m 14s
-
(Locked)
Create JSON challenge37s
-
(Locked)
Create JSON solution1m 22s
-
(Locked)
Documenting one-level JSON responses2m 28s
-
(Locked)
Documenting nested JSON responses6m 7s
-
(Locked)
Documenting JSON requests5m 32s
-
(Locked)
Documenting JSON challenge35s
-
(Locked)
Documenting JSON solution2m 47s
-
-
-
-