نمای کلی Google Docs API
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Google Docs API به شما امکان می دهد اسناد را در Google Docs ایجاد و اصلاح کنید.
برنامهها میتوانند با Docs API ادغام شوند تا اسناد صیقلی را هم از دادههای کاربر و هم از دادههای ارائهشده توسط سیستم ایجاد کنند. Docs API به شما امکان می دهد:
- فرآیندها را خودکار کنید
- مستندات را به صورت عمده ایجاد کنید
- فرمت اسناد
- فاکتورها یا قراردادها ایجاد کنید
- ویژگی های خاص اشیاء را بازیابی کنید
در زیر لیستی از اصطلاحات رایج مورد استفاده در Docs API آمده است:
- شناسه سند
شناسه منحصر به فرد برای یک سند. این یک رشته خاص است که حاوی حروف، اعداد و برخی کاراکترهای خاص است که به یک سند اشاره میکند و میتوان آن را از URL سند مشتق کرد. شناسههای سند پایدار هستند، حتی اگر نام سند تغییر کند. برای اطلاعات بیشتر در مورد نحوه یافتن شناسه، به شناسه سند مراجعه کنید.
https://docs.google.com/document/d/DOCUMENT_ID/edit
- عنصر
ساختاری که یک سند را تشکیل می دهد. عناصر سطح بالای یک سند عبارتند از Body
، DocumentStyle
و List
.
- سند Google Workspace
فایلی که یک برنامه Google Workspace، مانند Google Docs، ایجاد می کند. قالب نوع MIME برای Docs application/vnd.google-apps.document
است. برای لیستی از انواع MIME، به انواع MIME پشتیبانی شده Google Workspace و Google Drive مراجعه کنید.
- شاخص
اکثر عناصر درون بدنه محتوا دارای ویژگی startIndex
و endIndex
هستند. اینها نشان دهنده انحراف شروع و پایان یک عنصر، نسبت به ابتدای بخش احاطه کننده آن است.
- تصویر درون خطی
تصویری که در جریان متن در یک سند ظاهر می شود. این یک پیوست نیست.
- محدوده نامگذاری شده
طیف متناوب متن. NamedRange
مجموعه ای از محدوده ها با همان namedRangeId
است. محدودههای نامگذاری شده به توسعهدهندگان اجازه میدهد تا بخشهایی از یک سند را با یک برچسب دلخواه تعریفشده توسط کاربر مرتبط کنند تا محتوای آنها بعداً بهصورت برنامهریزی خوانده یا ویرایش شود. یک سند میتواند شامل چندین محدوده نامگذاری شده با یک نام باشد، اما هر محدوده نامگذاری شده یک شناسه منحصربهفرد دارد.
- بخش
Body
، Header
، Footer
یا Footnote
حاوی عناصر ساختاری یا محتوایی. شاخص های عناصر داخل یک بخش نسبت به ابتدای آن بخش است.
- پیشنهاد
تغییر در یک سند بدون تغییر متن اصلی. اگر مالک پیشنهادات شما را تأیید کند، متن اصلی را جایگزین میکند.
برای آشنایی با توسعه با Google Workspace APIها، از جمله رسیدگی به احراز هویت و مجوز، به Develop on Google Workspace مراجعه کنید.
برای دریافت یک نمای کلی مفهومی از یک سند، به سند مراجعه کنید.
برای یادگیری نحوه پیکربندی و اجرای برنامه Docs API، شروع سریع جاوا اسکریپت را امتحان کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Google Docs API overview\n\nThe Google Docs API lets you create and modify documents in Google Docs.\n\nApplications can integrate with the Docs API to create polished\ndocuments from both user and system-provided data. The Docs API lets\nyou:\n\n- Automate processes\n- Create documentation in bulk\n- Format documents\n- Generate invoices or contracts\n- Retrieve specific attributes of objects\n\nThe following is a list of common terms used in the Docs API:\n\n*Document ID*\n\n: The unique identifier for a document. It's a particular string containing\n letters, numbers, and some special characters that reference a document and\n it can be derived from the document's URL. Document IDs are stable, even if\n the document name changes. For more information on how to find the ID, see\n [Document ID](/workspace/docs/api/concepts/document#document-id).\n\n https://docs.google.com/document/d/\u003cvar translate=\"no\"\u003eDOCUMENT_ID\u003c/var\u003e/edit\n\n*Element*\n\n: The structure that makes up a document. Top-level elements of a document\n include the [`Body`](/workspace/docs/api/reference/rest/v1/documents#body),\n [`DocumentStyle`](/workspace/docs/api/reference/rest/v1/documents#documentstyle), and\n [`List`](/workspace/docs/api/reference/rest/v1/documents#list).\n\n*Google Workspace document*\n\n: A file that a Google Workspace application, like Google Docs, creates.\n The MIME type format for Docs is\n `application/vnd.google-apps.document`. For a list of MIME types, see [Google Workspace and Google Drive supported MIME types](/drive/api/guides/mime-types).\n\n*Index*\n\n: Most *elements* within the content body have the `startIndex` and `endIndex`\n properties. These indicate the offset of an element's beginning and end,\n relative to the beginning of its enclosing *segment*.\n\n*Inline image*\n\n: An image that appears in the flow of text within a document. It's not an\n attachment.\n\n*Named range*\n\n: A contiguous range of text. A\n [`NamedRange`](/workspace/docs/api/reference/rest/v1/documents#namedrange) is a\n collection of ranges with the same `namedRangeId`. Named ranges allow\n developers to associate parts of a document with an arbitrary user-defined\n label so their contents can be programmatically read or edited later. A\n document can contain multiple named ranges with the same name, but every\n named range has a unique ID.\n\n*Segment*\n\n: The `Body`, [`Header`](/workspace/docs/api/reference/rest/v1/documents#header),\n [`Footer`](/workspace/docs/api/reference/rest/v1/documents#footer), or\n [`Footnote`](/workspace/docs/api/reference/rest/v1/documents#footnote) containing\n structural or content *elements* . The *indexes* of the elements within a\n segment are relative to the beginning of that segment.\n\n*Suggestion*\n\n: Changes to a document without changing the original text. If the owner\n approves your suggestions, they replace the original text.\n\nRelated topics\n--------------\n\n- To learn about developing with Google Workspace APIs, including handling\n authentication and authorization, refer to [Develop on\n Google Workspace](/workspace/guides/get-started).\n\n- To get a conceptual overview of a document, see\n [Document](/workspace/docs/api/concepts/document).\n\n- To learn how to configure and run a Docs API app, try the\n [JavaScript quickstart](/workspace/docs/api/quickstart/js)."]]