Method: documents.get
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
GET https://docs.googleapis.com/v1/documents/{documentId}
网址采用 gRPC 转码语法。
路径参数
参数 |
documentId |
string
要检索的文档的 ID。
|
查询参数
参数 |
suggestionsViewMode |
enum (SuggestionsViewMode )
要应用于文档的建议视图模式。这样,您就可以在文档中查看所有建议(已接受或已拒绝)。如果未指定,则系统会使用 DEFAULT_FOR_CURRENT_ACCESS 。
|
includeTabsContent |
boolean
是否在 Document 上填充 Document.tabs 字段,而不是文本内容字段(例如 body 和 documentStyle )。
|
响应正文
如果成功,则响应正文包含一个 Document
实例。
授权范围
需要以下 OAuth 范围之一:
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
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-22。
[null,null,["最后更新时间 (UTC):2025-03-22。"],[],[],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)."]]