Find Parent File ID: Google Drive V3 API

enter image description here

Today, after I upgraded my disk API to V3, I did not find any method to find the parent of the selected file. Is there a breakpoint left for fetching json related to parent information information?

+4
source share
2 answers

If you have the file identifier of the file in question, then Files: get you need to add fields, i.e. parents along with the file identifier.

Request

GET https://www.googleapis.com/drive/v3/files/0B5pJkOVaKccENWNNcFFaU2lSM0E?fields=parents&key= {YOUR_API_KEY}

Returns

{ "": [ "0B5pJkOVaKccEYW5lVHBKd1Zwc28" ]}

. , .

.

GET https://www.googleapis.com/drive/v3/files/0B5pJkOVaKccEYW5lVHBKd1Zwc28?key= {YOUR_API_KEY}

{ "kind": "drive # file", "id": "0B5pJkOVaKccEYW5lVHBKd1Zwc28", "name": "SiteBackups", "mimeType": "application/vnd.google-apps.folder" }

+4

, Google Drive API 3 , .:)

3 . , files.get . , . . , .

v2 v3, .

+3

Source: https://habr.com/ru/post/1619829/


All Articles