Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get file's 'lastModified' in Google Drive API v3?

I recently decided to migrate from Drive API v2 to v3.

In v2, files().get(fileId) returns almost all attributes, but in v3, it doesn't return the lastModified, which is very essential for me. Is there anyway I can do it in v3?

like image 454
Adesh Atole Avatar asked Feb 16 '16 15:02

Adesh Atole


People also ask

How do I get files from Google Drive API?

If you provide the URL parameter alt=media , then the response includes the file contents in the response body. Downloading content with alt=media only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use files. export instead.

How do I find Google Drive file ID?

In my opinion the easiest and fastest way to get a Google Drive file ID is from Google Drive on the web. Right-click the file name and select Get shareable link. The last part of the link is the file ID.


1 Answers

In Drive API v3 full resources are no longer returned by default. Use the fields query parameter to request specific fields to be returned. See docs.

like image 94
Zeehad Avatar answered Oct 13 '22 05:10

Zeehad