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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With