Search code examples
google-docs-api

How to check if the Resource ID of a document in Google Docs is for KIX or Writely


I need the way to distinguish the previous version of Google Docs' Document from the latest one, only by Resource ID. As there seems to be no document about this, I scanned thousands of documents and found the pattern below.

[The latest version(KIX)]

  • The ID always starts with 1
  • Length always 44 bytes

[The previous version(Writely)]

  • The ID always starts with 0 (In my case, 0Aeva… and 0ASWU6_… are the only prefix)
  • Length from 39 to 41 bytes

It seems okay to use the head character (1 or 0) or the length(more than 43 bytes or not) to distinguish them, but it is just a guess.

I would like to ask Google Docs API support staff the currently right way to distinguish them, if it is not a secret. It is okay the naming rule may change in the future.

Any information is welcome. Thank you.


Solution

  • There is no stable, documented, or official way to distinguish them. If your way works, I suggest you use it.

    Of course one day, Writely documents will no longer exist, so this will no longer be a problem.