Search code examples
google-apigoogle-api-js-client

Google Drive API - deconstructing comment anchors


When using the Google Drive Comments API, I can pull in the comments on a specific file, but I'd like to also see the text that the comment is associated with. My understanding is that this is the anchor field in the response

According to the anchor docs (very light on documentation), the anchor should include a revision ID, plus a beginning and end to the anchor text, and look like this

      'r': revisionId,
      'a': [
      {
        'line':
        {
          'n': 12,
          'l': 3,
        }
      },
      {
        'line':
        {
          'n': 18,
          'l': 1,
        }
      }]
    }

However, when I pull the comments in, my anchor looks like this

{
   ...
   "anchor": "kix.fkuox8etb960",
   ...
}

Does anyone know how to use this interesting looking ID to get to the structure shown in the documents? Thanks


Solution

  • Basically, if I understand you correctly, you are looking for a way to retrieve the location data of a comment anchor in a document. Unfortunately, from going through the Google Drive Comments API and checking out this SO answer, it seems there is no support for this at the moment. I also checked out the issue trackers that were posted in the SO answer I referred to, and there doesn't seem to be an advancement there, expect many other people "+1ing" for it.