Code sample documentation conventions

  • Intro phrase: "The following example shows how to..."
  • Inline comments: "Replace X with your actual Y" and "The response will contain..."
  • Callouts: Note / Tip / Warning — specific, actionable, with consequences
  • Placeholders: ALL_CAPS names matching the code block exactly
  • Copy-paste-ready: complete, runnable code with no ellipsis gaps

Question 0 of 5

Which sentence best introduces a code sample in API documentation?