documents

GET /v1/documents/{documentId}

Changed on

Gets the latest version of the specified document.

Request

  • Base URL
    https://docs.googleapis.com
  • URL
    https://docs.googleapis.com/v1/documents/{documentId}
  • Auth
    • OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/documents
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/documents
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/documents.readonly
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/documents.readonly
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/drive
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/drive
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/drive.file
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/drive.file
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/drive.readonly
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/drive.readonly

Path parameters

documentIdstring required

The ID of the document to retrieve.

Query parameters

commentsViewMode'COMMENTS_VIEW_MODE_UNSPECIFIED' | 'COMMENTS_VIEW_MODE_DEFAULT_FOR_CURRENT_ACCESS' | 'COMMENTS_VIEW_MODE_OMITTED' | 'COMMENTS_VIEW_MODE_INCLUDED'

The comments view mode to apply to the document. This allows viewing the document with comments omitted or included. If one is not specified, COMMENTS_VIEW_MODE_OMITTED is used. If you set comments_view_mode to any value, you must also set include_tabs_content to true or use a field mask that references the Document.tabs field (or any subfield). If you set comments_view_mode to COMMENTS_VIEW_MODE_INCLUDED, you must also explicitly set suggestions_view_mode to SUGGESTIONS_INLINE. If you set comments_view_mode to COMMENTS_VIEW_MODE_INCLUDED or COMMENTS_VIEW_MODE_DEFAULT_FOR_CURRENT_ACCESS, you may not set suggestions_view_mode to PREVIEW_WITHOUT_SUGGESTIONS or PREVIEW_SUGGESTIONS_ACCEPTED.

includeTabsContentboolean

Whether to populate the Document.tabs field instead of the text content fields like body and documentStyle on Document. - When true: Document content populates in the Document.tabs field instead of the text content fields in Document. - When false: The content of the document's first tab populates the content fields in Document excluding Document.tabs. If a document has only one tab, then that tab is used to populate the document content. Document.tabs will be empty. If you use a field mask that references the Document.tabs field (or any subfield), the API implicitly treats the request as if you set include_tabs_content to true.

suggestionsViewMode'DEFAULT_FOR_CURRENT_ACCESS' | 'SUGGESTIONS_INLINE' | 'PREVIEW_SUGGESTIONS_ACCEPTED' | 'PREVIEW_WITHOUT_SUGGESTIONS'

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 is used.

Response

Successful response

commentsViewMode'COMMENTS_VIEW_MODE_UNSPECIFIED' | 'COMMENTS_VIEW_MODE_DEFAULT_FOR_CURRENT_ACCESS' | 'COMMENTS_VIEW_MODE_OMITTED' | 'COMMENTS_VIEW_MODE_INCLUDED'

Output only. The comments view mode applied to the document.

documentIdstring

Output only. The ID of the document.

footersobject

Output only. The footers in the document, keyed by footer ID. Legacy field: Instead, use Document.tabs.documentTab.footers, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

footnotesobject

Output only. The footnotes in the document, keyed by footnote ID. Legacy field: Instead, use Document.tabs.documentTab.footnotes, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

headersobject

Output only. The headers in the document, keyed by header ID. Legacy field: Instead, use Document.tabs.documentTab.headers, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

inlineObjectsobject

Output only. The inline objects in the document, keyed by object ID. Legacy field: Instead, use Document.tabs.documentTab.inlineObjects, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

listsobject

Output only. The lists in the document, keyed by list ID. Legacy field: Instead, use Document.tabs.documentTab.lists, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

namedRangesobject

Output only. The named ranges in the document, keyed by name. Legacy field: Instead, use Document.tabs.documentTab.namedRanges, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

positionedObjectsobject

Output only. The positioned objects in the document, keyed by object ID. Legacy field: Instead, use Document.tabs.documentTab.positionedObjects, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

revisionIdstring

Output 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.

suggestedDocumentStyleChangesobject

Output only. The suggested changes to the style of the document, keyed by suggestion ID. Legacy field: Instead, use Document.tabs.documentTab.suggestedDocumentStyleChanges, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

suggestedNamedStylesChangesobject

Output only. The suggested changes to the named styles of the document, keyed by suggestion ID. Legacy field: Instead, use Document.tabs.documentTab.suggestedNamedStylesChanges, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to true. If false or unset, this field contains information about the first tab in the document.

suggestionsViewMode'DEFAULT_FOR_CURRENT_ACCESS' | 'SUGGESTIONS_INLINE' | 'PREVIEW_SUGGESTIONS_ACCEPTED' | 'PREVIEW_WITHOUT_SUGGESTIONS'

Output only. The suggestions view mode applied to the document. Note: When editing a document, changes must be based on a document with SUGGESTIONS_INLINE.

titlestring

The title of the document.

Changes

    • breaking

      removed the media type */* for the response with the status

    • info

      the security scope https://www.googleapis.com/auth/documents was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/documents was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/drive.readonly was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive.readonly was removed from the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/documents was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/documents was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/drive.readonly was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive.readonly was removed from the endpoint's security scheme Oauth2c

    • info

      added the new optional query request parameter commentsViewMode

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property /////// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property ////////// to the response with the status

    • info

      added the optional property ////////// to the response with the status

    • info

      added the optional property ////////// to the response with the status