Fictional API example. This page demonstrates documentation features; its operations do not describe a live service.
The Notes API is fictional. This short guide demonstrates how a task page can point readers to an API reference without hard-coding the reference's URL.
Prepare a note
Choose a short message and save this JSON as request.json. The fictional create operation accepts this body at POST /notes:
{"text":"Hello from Shoalrun!"}
The API references linked below cover creating and reading a note. The links on this page and on each reference are generated from relatedApiReferences in this guide's frontmatter. The Create a note page has an authored introduction; the Get a note page is generated from the spec without an MDX source page.
Check the request
From the directory containing request.json, check that the message is a nonempty string:
node -e 'const note = require("./request.json"); if (typeof note.text !== "string" || !note.text.trim()) process.exit(1); console.log(note.text)'
The example prints Hello from Shoalrun! and exits successfully. If parsing fails or the command exits with code 1, correct the JSON or supply a nonempty message. Compare the payload with the Create a note contract before adapting it to a real API. This check validates the local example; the fixture has no live endpoint to receive a request.
Related reading
Next steps
Related API references
- Create a note — Preview an API operation page built from a small, fictional OpenAPI file.
- Get a note — GET /notes/{id}