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.
API Google Tài liệu cho phép bạn tạo và sửa đổi tài liệu trong Google Tài liệu.
Các ứng dụng có thể tích hợp với API Tài liệu để tạo tài liệu hoàn chỉnh từ cả dữ liệu do người dùng và hệ thống cung cấp. API Tài liệu cho phép bạn:
Tự động hoá quy trình
Tạo tài liệu hàng loạt
Định dạng tài liệu
Tạo hoá đơn hoặc hợp đồng
Truy xuất các thuộc tính cụ thể của đối tượng
Sau đây là danh sách các thuật ngữ phổ biến được dùng trong API Tài liệu:
Mã số giấy tờ
Giá trị nhận dạng duy nhất của một tài liệu. Đây là một chuỗi cụ thể chứa chữ cái, số và một số ký tự đặc biệt tham chiếu đến một tài liệu và có thể được lấy từ URL của tài liệu. Mã tài liệu luôn ổn định, ngay cả khi tên tài liệu thay đổi. Để biết thêm thông tin về cách tìm mã nhận dạng, hãy xem phần Mã nhận dạng tài liệu.
Cấu trúc tạo nên một tài liệu. Các phần tử cấp cao nhất của tài liệu bao gồm Body, DocumentStyle và List.
Tài liệu trên Google Workspace
Tệp mà một ứng dụng Google Workspace (chẳng hạn như Google Tài liệu) tạo ra. Định dạng loại MIME cho Tài liệu là application/vnd.google-apps.document. Để biết danh sách các loại MIME, hãy xem bài viết Các loại MIME được Google Workspace và Google Drive hỗ trợ.
Chỉ mục
Hầu hết phần tử trong phần nội dung đều có thuộc tính startIndex và endIndex. Các giá trị này cho biết độ dời của phần đầu và phần cuối của một phần tử, tương ứng với phần đầu của phân đoạn bao hàm phần tử đó.
Hình ảnh nội tuyến
Hình ảnh xuất hiện trong dòng văn bản của một tài liệu. Đây không phải là tệp đính kèm.
Dải ô được đặt tên
Một dải văn bản liền kề. NamedRange là một tập hợp các dải ô có cùng namedRangeId. Dải ô được đặt tên cho phép nhà phát triển liên kết các phần của tài liệu với một nhãn do người dùng xác định tuỳ ý để có thể đọc hoặc chỉnh sửa nội dung của các phần đó theo phương thức lập trình sau này. Một tài liệu có thể chứa nhiều dải ô được đặt tên có cùng tên, nhưng mỗi dải ô được đặt tên đều có mã nhận dạng duy nhất.
Segment
Body, Header, Footer hoặc Footnote chứa các phần tử cấu trúc hoặc nội dung. Chỉ mục của các phần tử trong một phân đoạn tương ứng với vị trí bắt đầu của phân đoạn đó.
Đề xuất
Nội dung thay đổi đối với một tài liệu mà không thay đổi văn bản gốc. Nếu chủ sở hữu chấp thuận đề xuất của bạn, nội dung đề xuất sẽ thay thế văn bản gốc.
Chủ đề có liên quan
Để tìm hiểu về cách phát triển bằng API Google Workspace, bao gồm cả việc xử lý xác thực và uỷ quyền, hãy tham khảo bài viết Phát triển trên Google Workspace.
Để biết thông tin tổng quan về khái niệm của một tài liệu, hãy xem phần Tài liệu.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-01 UTC."],[],[],null,["The 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- 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)."]]