GET
/api/google-docs/documentsGoogle Doc full content (documents.get)
Google Docs documents.get — full structural content of a document.
Mocks Docs API v1 documents.get. Returns the full body.content[] StructuralElement array: paragraphs with elements[]/textRun.content/textStyle + paragraphStyle.namedStyleType (TITLE, HEADING_2, NORMAL_TEXT). Includes documentStyle (margins, page size), namedStyles, and (empty in mock) lists / inlineObjects / headers / footers / footnotes.
Query parameters
| Name | Type | Description |
|---|---|---|
documentIdrequired | string | Drive file ID from /api/google-docs/files. e.g. 1V3lTRxLaunchPlanH1_2026_xyz12345AbCdEfGhIjKlMn |
Response schema
| Path | Type | Description |
|---|---|---|
documentId | string | Echo of the documentId param. |
title | string | Document title. |
revisionId | string | Versioning token. |
body.content[] | array | Structural elements — each entry has exactly one of: paragraph | sectionBreak | table | tableOfContents. |
body.content[].paragraph.elements[] | array | Paragraph children. Each carries a textRun. |
body.content[].paragraph.elements[].textRun.content | string | Text segment ending in newline. |
body.content[].paragraph.elements[].textRun.textStyle | object | { bold, italic, fontSize, ... } as applicable. |
body.content[].paragraph.paragraphStyle.namedStyleType | enum | TITLE | SUBTITLE | HEADING_1 | HEADING_2 | HEADING_3 | NORMAL_TEXT. Source: Docs API NamedStyleType |
documentStyle | object | Margins, page size (US Letter). |
namedStyles.styles[] | array | Style definitions per NamedStyleType. |
lists / inlineObjects / headers / footers / footnotes | object | Empty in mock; included for API shape parity. |
Behaviour notes
- ·First paragraph is always TITLE-styled.
- ·Short non-period-terminated lines are inferred as HEADING_2.
- ·All other paragraphs are NORMAL_TEXT.
- ·Unknown documentId returns 404 with Google's standard error shape.
Examples
Launch plan document
curl 'http://localhost:3000/api/google-docs/documents?documentId=1V3lTRxLaunchPlanH1_2026_xyz12345AbCdEfGhIjKlMn'G-BA lessons learned (2024)
curl 'http://localhost:3000/api/google-docs/documents?documentId=1K7GBADossier2024Lessons_efg321HiJkLmNoPqRsTuVwX'Sources
- Docs API v1 — documents.gethttps://developers.google.com/docs/api/reference/rest/v1/documents/get
- Docs API v1 — Document resourcehttps://developers.google.com/docs/api/reference/rest/v1/documents