1

I have opened a push notification channel using Google drive API. Whenever a file is changed, I got a notification on the channel with the resource URI. I used the resource URI to fetch the latest changes. I got the same response whenever the content of the file changed and whenever the comment is added to the file. The changed response looks like this:

{
    kind: "drive#changeList"
    newStartPageToken: "7296"
    changes {
        kind: "drive#change"
        type: "file"
        changeType: "file"
        time: "2022-05-11T15:51:17.452Z"
        file {
            kind: "drive#file"
            id: "FILE_ID"
            name: "Google Business Message"
            mimeType: "application/vnd.google-apps.document"
        }
    }
}

By using the file Id I can fetch the file details from this endpoint : https://www.googleapis.com/drive/v3/files/FILE_ID

And I can fetch the file comment list using https://www.googleapis.com/drive/v3/files/FILE_ID/comments

But, the problem is how can I know if I received the change notification because of file modifications or because of a new comment made to the file? I need to fetch the newly added comment on the file.

Kiran Subedi
  • 2,244
  • 3
  • 17
  • 34

0 Answers0