Method: documents.get
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Lấy phiên bản mới nhất của tài liệu đã chỉ định.
Yêu cầu HTTP
GET https://docs.googleapis.com/v1/documents/{documentId}
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
documentId |
string
Mã của tài liệu cần truy xuất.
|
Tham số truy vấn
Thông số |
suggestionsViewMode |
enum (SuggestionsViewMode )
Chế độ xem đề xuất để áp dụng cho tài liệu. Thao tác này cho phép xem tài liệu với tất cả đề xuất cùng dòng, đã được chấp nhận hoặc bị từ chối. Nếu bạn không chỉ định, hệ thống sẽ sử dụng DEFAULT_FOR_CURRENT_ACCESS .
|
includeTabsContent |
boolean
Liệu có nên điền trường Document.tabs thay vì các trường nội dung văn bản như body và documentStyle trên Document hay không.
Khi True : Nội dung tài liệu sẽ được điền vào trường Document.tabs thay vì các trường nội dung văn bản trong Document .
Khi False : Nội dung của thẻ đầu tiên của tài liệu sẽ điền sẵn các trường nội dung trong Document , ngoại trừ Document.tabs . Nếu tài liệu chỉ có một thẻ, thì thẻ đó sẽ được dùng để điền nội dung tài liệu. Document.tabs sẽ trống.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của Document
.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
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
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-03-22 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-03-22 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)."]]