Google Drive API: No Parents with drive.files.get

Viewed 786

I am using the Google Drive API. I can get a list of files with the drive.files.list API method. Here is the result of a call to this method:

{
 "files": [
  {
   "id": "1yLJFT2bHhsz1WxJX29mD9DiNz0vLDlBvzJf5GJCcboI",
   "mimeType": "application/vnd.google-apps.spreadsheet",
   "parents": [
    "0Bwy7SlKkxnwQRld6RWljU0Y4TG8"
   ]
  },
  {
   "id": "0Bwy7SlKkxnwQVXdBRmlPMGNoTmM",
   "mimeType": "application/vnd.google-apps.folder",
   "parents": [
    "0B4jAnSzS-VxlZW9RcDJheU5FYW8"
   ]
  },
  {
   "id": "0Bwy7SlKkxnwQRld6RWljU0Y4TG8",
   "mimeType": "application/vnd.google-apps.folder",
   "parents": [
    "0Bwy7SlKkxnwQQndiQnYxbUF4SjQ"
   ]
  }]
}

When I request individual files using the drive.files.get API call, I would expect to get the same results as shown in the list above. I do when I request the first and third file listed. For example:

GET https://www.googleapis.com/drive/v3/files/0Bwy7SlKkxnwQRld6RWljU0Y4TG8?supportsTeamDrives=true&fields=id%2CmimeType%2Cparents

Result:

{
 "id": "0Bwy7SlKkxnwQRld6RWljU0Y4TG8",
 "mimeType": "application/vnd.google-apps.folder",
 "parents": [
  "0Bwy7SlKkxnwQQndiQnYxbUF4SjQ"
 ]
}

This is identical to what is shown in the list. But for some reason when I request the second file in the list, the parents list is missing from the result:

GET https://www.googleapis.com/drive/v3/files/0Bwy7SlKkxnwQVXdBRmlPMGNoTmM?supportsTeamDrives=true&fields=id%2CmimeType%2Cparents

Result:

{
 "id": "0Bwy7SlKkxnwQVXdBRmlPMGNoTmM",
 "mimeType": "application/vnd.google-apps.folder"
}

No parents array. Can anyone explain this behavior? I assumed all files should have a parent.

1 Answers
Related