Search code examples
google-apps-scriptgoogle-docs-api

Google docs API: Document, where are the comments and bookmarks?


Per https://developers.google.com/docs/api/reference/rest/v1/documents/get I can retrieve a document

The result is structured as described at https://developers.google.com/docs/api/reference/rest/v1/documents#Document

but I am missing the bookmarks and comments of a doc. They are neither in that description or in the real world retrieved object.

Is it possible to retrieve comments and/or bookmarks from a google-doc?


Solution

  • About bookmarks:

    Unfortunately, in the current stage, the bookmarks cannot be retrieved by Google Docs API. Because the source bookmark ID cannot be retrieved by Docs API while the bookmark ID can be retrieved from the text linked to the bookmark. - Docs API is growing now. So I think that the methods for managing the bookmarks will be added in the future update.

    Workaround:

    As a current workaround, I think that Web Apps created with Google Apps Script might be able to be used as an API for achieving above situation. Document service of Google Apps Script can retrieve the bookmark ID. Ref

    About comments:

    The comments can be retrieved by the method of Comments in Drive API. The comments cannot be retrieved by Docs API.

    References: