Today after I updated my Drive API to V3, I dint find any method to find the parent of the selected file . Is the rest endpoint to fetch json related to parent's info changed?
Getting this folder ID is easy, navigate to https://drive.google.com and make a folder. After you did this, open up the folder and check the URL: Grab this ID and enter it inside the 'Folder ID's' inside the modal to specify that the backup has to be put in that folder.
You'd need to grab the title of the doc and search for it in your Drive list view. The search results should show you the document title, then also show the name of the parent folder in gray. A round about way but it's a solution. Thanks!
If the file is Public on the web or accessible via a link, yes, you can. The same applies to being directly shared with you via email, except there are no extra steps, just press "Share" and you'll see the editors and owners.
If you have the file id of the file in question then Files: get you need to add fields ie parents along with the file id.
Request
GET https://www.googleapis.com/drive/v3/files/0B5pJkOVaKccENWNNcFFaU2lSM0E?fields=parents&key={YOUR_API_KEY}
Returns
{ "parents": [ "0B5pJkOVaKccEYW5lVHBKd1Zwc28" ] }
The result is actually a file id. Remember files and directories are the same in Drive.
Do files.get again
GET https://www.googleapis.com/drive/v3/files/0B5pJkOVaKccEYW5lVHBKd1Zwc28?key={YOUR_API_KEY}
Results
{ "kind": "drive#file", "id": "0B5pJkOVaKccEYW5lVHBKd1Zwc28", "name": "SiteBackups", "mimeType": "application/vnd.google-apps.folder" }
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