I need to write a very simple script for retrieving the comments added to a file using the file ID, and store the comments to the activesheet I have found this page but I don't really know how to get the code running with an app script.
function retrieveComments(fileId, callback) {
var request = gapi.client.drive.comments.list({
'fileId': fileId
});
request.execute(callback);
}
Every time I run the code I just get this error:
ReferenceError: "gapi" is not defined. (line 2, file "Comment").
Any help will be highly appreciated!