I am trying to see if I can update created and modified date of a mp4 file on Google drive.
This is not a question from a developer stand point but anything that can help me to get the job done would work. That said, if there is some way in Google Drive UI (Web App or smart phone app etc.) or using [Google's API harness][1]
to update the modified date of a file, I am ok with it. If your answer includes using API harness, please let me know where can I get the values for the API's parameters so I can run the API call from my login.
Just curious, if I somehow manage to update the modified time of the same file on my computer's hard drive, and then upload it (replace/revise an existing file on Google drive) would it read the meta-data from the file, or Google would use the time I uploaded the document as "modified date"?
Please note:
This is not specifically Google Drive API question, but if Google has an API test harness and I can put in some parameters there to update the file meta-data, I do not mind going to that route.
The Drive API allows access to Comments and Changes on documents but I don't see the new action items feature in the reference documentation.
Is there a way to perform any of the standard CRUD operations on them: get a list of them, get their properties, add new ones, modify them, etc.?
I'm actually interested in doing this through Google Apps Script but I understand that even Comments are only available in the Drive API, so I suspect if there's a way to do it it would be through the Drive API first.
I'm using Drive REST API v2 to list the revisions of a Google Doc or Sheet, but the resulting list is incomplete. I'm not able to retrieve the same list of files available at File > Revision History. I've detected the same behaviour with Drive REST API v3.
Is anyone having the same issue? May I have to send a specific param in order to get a detailed list?
The Google Drive API v2 Drive.revisions.update method allows the setting of a pinned parameter so that the particular revision is never automatically purged. However as the documentation says, this does not apply for Google Docs. How can we pin a revision so it is never deleted? I have an app that depends on tracking and retreiving certain revisions at a later point in time.
Any suggestions on how this can be done?
Google docs (as well as all native google formats like spreadsheet) does NOT get any revisions deleted automatically, thus there is no need to pin revisions.
If you were referring to .doc, those aren't Google docs.
I couldn't find a reference inside the documentation, but I did find an official reference in their marketing page:
https://apps.google.com/intx/en/products/docs/ says:
Unlimited revision history
Track changes made to your documents and undo anything you choose. Previous versions are kept indefinitely and they don't count toward your storage.
It seems that Google is clear about this.
pinned - This will only be populated and can only be modified on files with content stored in Drive which are not Google Docs.
Try converting your revision files to pdf (non Google Doc). You can then keep the revisions using pinned = true.
Is there a way to use the Google Drive API's from Google Apps Script. I am aware of the DocsList Service, which allows you to look at folders and files , however what about all the other API's in Google Drive (Files,About,Changes,Children,Parents,Permissions,Revisions,Apps,Comments,Replies). For example, is there API access to add Comments to files from Google Apps Script.
Apps Script has the ability to access Google API's, but you need to explicitly enable them before they can be used.
In the code editor, choose RESOURCES, ADVANCED GOOGLE SERVICES
Click the OFF button, to turn the service ON.
Before you close the dialog box, click the link at the bottom to open up the API Manager.
Once you've completed those two steps, the Drive API is available inside of Apps Script. Type the key word Drive then type a period, and available methods will show up in a list.
Methods
get - Gets a file's metadata by ID.
insert - Insert a new file.
patch - Updates file metadata. This method supports patch semantics.
update - Updates file metadata and/or content.
copy - Creates a copy of the specified file.
delete - Permanently deletes a file by ID. Skips the trash.
list - Lists the user's files.
touch - Set the file's updated time to the current server time.
trash - Moves a file to the trash
untrash - Restores a file from the trash.
watch - Start watching for changes to a file.
emptyTrash - Permanently deletes all of the user's trashed files.
https://developers.google.com/drive/v2/reference/files#methods
(Google-Apps-Script=GAS) Drive Services added 2013.05.13 (to be announced at the 2013 Google I/O 2 days later) is apparently-exactly designed to replace the prior API(DocsList) and allow GAS to access the Google Drive SDK, though that functionality is currently not mentioned (why?) from those official docs but it is most certainly suggested by the new new API name "Drive" and is stated at as the purpose by Google's great demo video "Integrate Google Drive with Google Apps Script — Google I/O 2013" and "Drive SDK" is mentioned in by the search functions as searchFiles(String).
And Drive Services works (I'm using it; and though I could think of many improvements, haven't found any bugs of memory) including it works for useful apps (see the the video above for one of the most impressive ones I've seen) but it isn't complete (including doesn't expose the full Drive SDK) including:
it doesn't (yet?) allow one to access prior versions of content (as that vide plus (the enhancement request: Google Search for "Issue 2811: Access the document revisions using DriveApp"),
control the indexing status & method of content,
one can't get a list of a file or folder's accessors (apparently deliberately says the video; but using the prior DocsList or Library mentioned seems like it would be a workaround).
I'd have included more links to help out but I'm a new poster here so the editor's telling me "You need at least 10 reputation to post more than 2 links.".
Yes, it's possible.
Take a look at the documentation for Class File, which includes functions for obtaining and/or changing most of the attributes you've listed.
For an example of code that gets some of this info for files and folders, see this answer.
You should also have a look at this Library written by Romain Vialard, one of the GAS TC.
It provides functions that are not available directly in gas or - at least - not as simply.