Method: documents.get
Stay organized with collections
Save and categorize content based on your preferences.
Gets the latest version of the specified document.
HTTP request
GET https://docs.googleapis.com/v1/documents/{documentId}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
documentId |
string
The ID of the document to retrieve.
|
Query parameters
Parameters |
suggestionsViewMode |
enum (SuggestionsViewMode )
The suggestions view mode to apply to the document. This allows viewing the document with all suggestions inline, accepted or rejected. If one is not specified, DEFAULT_FOR_CURRENT_ACCESS is used.
|
includeTabsContent |
boolean
Whether to populate the Document.tabs field instead of the text content fields like body and documentStyle on Document .
When True : Document content populates in the Document.tabs field instead of the text content fields in Document .
When False : The content of the document's first tab populates the content fields in Document excluding Document.tabs . If a document has only one tab, then that tab is used to populate the document content. Document.tabs will be empty.
|
Request body
The request body must be empty.
Response body
If successful, the response body contains an instance of Document
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/documents.readonly
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.file
For more information, see the Authorization guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-21 UTC.
[null,null,["Last updated 2025-03-21 UTC."],[],[],null,["# Method: documents.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGets the latest version of the specified document.\n\n### HTTP request\n\n`GET https://docs.googleapis.com/v1/documents/{documentId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------|----------------------------------------------|\n| `documentId` | `string` The ID of the document to retrieve. |\n\n### Query parameters\n\n| Parameters ||\n|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `suggestionsViewMode` | `enum (`[SuggestionsViewMode](/workspace/docs/api/reference/rest/v1/documents#SuggestionsViewMode)`)` The suggestions view mode to apply to the document. This allows viewing the document with all suggestions inline, accepted or rejected. If one is not specified, [DEFAULT_FOR_CURRENT_ACCESS](/workspace/docs/api/reference/rest/v1/documents#SuggestionsViewMode) is used. |\n| `includeTabsContent` | `boolean` Whether to populate the [Document.tabs](/workspace/docs/api/reference/rest/v1/documents#Document.FIELDS.tabs) field instead of the text content fields like `body` and `documentStyle` on [Document](/workspace/docs/api/reference/rest/v1/documents#Document). - When `True`: Document content populates in the [Document.tabs](/workspace/docs/api/reference/rest/v1/documents#Document.FIELDS.tabs) field instead of the text content fields in [Document](/workspace/docs/api/reference/rest/v1/documents#Document). - When `False`: The content of the document's first tab populates the content fields in [Document](/workspace/docs/api/reference/rest/v1/documents#Document) excluding [Document.tabs](/workspace/docs/api/reference/rest/v1/documents#Document.FIELDS.tabs). If a document has only one tab, then that tab is used to populate the document content. [Document.tabs](/workspace/docs/api/reference/rest/v1/documents#Document.FIELDS.tabs) will be empty. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Document](/workspace/docs/api/reference/rest/v1/documents#Document).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/documents`\n- `https://www.googleapis.com/auth/documents.readonly`\n- `https://www.googleapis.com/auth/drive`\n- `https://www.googleapis.com/auth/drive.readonly`\n- `https://www.googleapis.com/auth/drive.file`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]