Location of a comment in its corresponding Google doc

后端 未结 1 1493
刺人心
刺人心 2021-01-27 02:22

Given a google doc retrieved through the Google docs API and its comments retrived with the Drive API,

How do you know where in the document a comment corresponds?

1条回答
  •  终归单人心
    2021-01-27 03:12

    You cannot retrieve the location of a comment using Drive API.

    As you can see in the official documentation, the Comment resource has an anchor field that provides information on the region of the document. Nevertheless, if you use the API to get information about a comment, you will see that the anchor field in the response is actually a string identifier composed of a kix prefix and a certain anchor ID as a suffix, which don't really give you an idea of where the comment is located.

    The problem is not just about retrieving the locations to which a comment is anchored, but also about creating anchored comments in a desired location using the API, as you can see here.

    Basically, as it is currently implemented, this anchor tool is meant for third-party integrations to use this API to specify their own custom anchor data.

    There are several open cases in Issue Tracker related to this:

    • https://issuetracker.google.com/issues/36756056
    • https://issuetracker.google.com/issues/36763384

    Reference:

    • https://developers.google.com/drive/api/v3/manage-comments
    • https://www.youtube.com/watch?v=ZBU52nacbLw

    0 讨论(0)
提交回复
热议问题