Method: parents.get
Pobiera określone odwołanie do elementu nadrzędnego.
Żądanie HTTP
GET https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}
Adres URL używa składni transkodowania gRPC.
Parametry ścieżki
Parametry |
fileId |
string
Identyfikator pliku.
|
parentId |
string
Identyfikator elementu nadrzędnego.
|
Treść żądania
Treść żądania musi być pusta.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu ParentReference
.
Zakresy autoryzacji
Wymaga jednego z tych zakresów protokołu OAuth:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
Niektóre zakresy są ograniczone. Aby można było z nich korzystać, aplikacja musi przeprowadzić ocenę zabezpieczeń. Więcej informacji znajdziesz w przewodniku na temat autoryzacji.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-04 UTC.
[null,null,["Ostatnia aktualizacja: 2024-09-04 UTC."],[[["Retrieves a specific parent reference for a file using a `GET` request to the specified endpoint."],["Requires providing `fileId` and `parentId` as path parameters in the request URL."],["The response body will contain a `ParentReference` object if the request is successful."],["Requires authorization with one of the listed OAuth scopes, such as `https://www.googleapis.com/auth/drive` or `https://www.googleapis.com/auth/drive.file`."]]],["The core action is a `GET` request to retrieve a specific parent reference using the URL: `https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}`. This requires specifying `fileId` and `parentId` as path parameters. The request body must be empty. A successful response contains a `ParentReference` instance. Authorization requires one of several OAuth scopes, some of which are restricted and need security assessment.\n"]]