Method: documents.get
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
آخرین نسخه سند مشخص شده را دریافت می کند.
درخواست HTTP
GET https://docs.googleapis.com/v1/documents/{documentId}
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
documentId | string شناسه سند برای بازیابی |
پارامترهای پرس و جو
پارامترها |
---|
suggestionsViewMode | enum ( SuggestionsViewMode ) حالت مشاهده پیشنهادات برای اعمال به سند. این اجازه می دهد تا سند را با همه پیشنهادات درون خطی، پذیرفته یا رد شده مشاهده کنید. اگر یکی مشخص نشده باشد، DEFAULT_FOR_CURRENT_ACCESS استفاده می شود. |
includeTabsContent | boolean فیلد Document.tabs به جای فیلدهای محتوای متنی مانند body و documentStyle on Document پر شود. وقتی True : محتوای سند در قسمت Document.tabs به جای فیلدهای محتوای متنی در Document پر می شود. وقتی False : محتوای اولین برگه سند، فیلدهای محتوا را در Document به استثنای Document.tabs پر می کند. اگر سندی فقط یک برگه داشته باشد، از آن برگه برای پر کردن محتوای سند استفاده میشود. Document.tabs خالی خواهد بود.
|
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه ای از 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
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-03-22 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 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)."]]