Skip to main content

documents

Overview

Namedocuments
TypeResource
Idgoogleworkspace.docs.documents

Fields

NameDatatypeDescription
positionedObjectsobjectOutput only. The positioned objects in the document, keyed by object ID.
footersobjectOutput only. The footers in the document, keyed by footer ID.
listsobjectOutput only. The lists in the document, keyed by list ID.
suggestedNamedStylesChangesobjectOutput only. The suggested changes to the named styles of the document, keyed by suggestion ID.
inlineObjectsobjectOutput only. The inline objects in the document, keyed by object ID.
footnotesobjectOutput only. The footnotes in the document, keyed by footnote ID.
namedRangesobjectOutput only. The named ranges in the document, keyed by name.
documentIdstringOutput only. The ID of the document.
namedStylesobjectThe named styles. Paragraphs in the document can inherit their TextStyle and ParagraphStyle from these named styles.
headersobjectOutput only. The headers in the document, keyed by header ID.
suggestedDocumentStyleChangesobjectOutput only. The suggested changes to the style of the document, keyed by suggestion ID.
revisionIdstringOutput only. The revision ID of the document. Can be used in update requests to specify which revision of a document to apply updates to and how the request should behave if the document has been edited since that revision. Only populated if the user has edit access to the document. The revision ID is not a sequential number but an opaque string. The format of the revision ID might change over time. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the document has not changed. Conversely, a changed ID (for the same document and user) usually means the document has been updated. However, a changed ID can also be due to internal factors such as ID format changes.
titlestringThe title of the document.
bodyobjectThe document body. The body typically contains the full document contents except for headers, footers, and footnotes.
suggestionsViewModestringOutput only. The suggestions view mode applied to the document. Note: When editing a document, changes must be based on a document with SUGGESTIONS_INLINE.
documentStyleobjectThe style of the document.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdocumentIdGets the latest version of the specified document.
createINSERTCreates a blank document using the title given in the request. Other fields in the request, including any provided content, are ignored. Returns the created document.
batchUpdateEXECdocumentIdApplies one or more updates to the document. Each request is validated before being applied. If any request is not valid, then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. Other requests do not need to return information; these each return an empty reply. The order of replies matches that of the requests. For example, suppose you call batchUpdate with four updates, and only the third one returns information. The response would have two empty replies, the reply to the third request, and another empty reply, in that order. Because other users may be editing the document, the document might not exactly reflect your changes: your changes may be altered with respect to collaborator changes. If there are no collaborators, the document should reflect your changes. In any case, the updates in your request are guaranteed to be applied together atomically.