So I'm trying to programmatically insert anchored comments on all the pdf files in a folder.
I read the following doc: https://developers.google.com/drive/api/v3/manage-comments#anchor I tried following the instructions to creating an anchored comment on a rectangular region. But whenever I do, it appears as an unanchored comment only. Any idea on what I'm doing wrong?
Here's my code:
function insertComment(driveAppFolderObject) {
let files = driveAppFolderObject.getFiles()
while (files.hasNext()){
let fileId = files.next().getId()
let comment = {'content':'Comment Testing',
'anchor':{
'r': 'head',
'a': [
{
'rect':
{
'x': 20,
'y': 20,
'w': 10,
'h': 10,
}
}]
}
};
Drive.Comments.insert(comment, fileId);
}
}