1

我正在显示谷歌驱动器根目录中的文件夹列表,并且我想在与其他人共享文件夹时显示一个图标,无论与谁共享。

是否可以在 file.list 请求中获取该信息?或者我必须为每个文件夹发出新请求以获取权限列表?

在 google docs api 中有一个包含此信息的类别标签。

问候,阿尔瓦罗。

4

1 回答 1

-1

当您使用 file.list 请求时,返回的响应正文将包含以下内容:

    {
       "kind": "drive#fileList",
        "etag": etag,
        "selfLink": string,
        "nextPageToken": string,
        "nextLink": string,
        "items": [files Resource]
    }

然后在【文件资源】中,结构如下:

 {
   "kind": "drive#file",
   "id": string,
   "etag": etag,
   "selfLink": string,
   "webContentLink": string,
   "alternateLink": string,
   "embedLink": string,
   "thumbnailLink": string,
   "title": string,
   "mimeType": string,
   "description": string,
   "labels": {
   "starred": boolean,
   "hidden": boolean,
   "trashed": boolean,
   "restricted": boolean,
   "viewed": boolean
    },
  "createdDate": datetime,
  "modifiedDate": datetime,
  "modifiedByMeDate": datetime,
  "lastViewedByMeDate": datetime,
  "sharedWithMeDate": datetime,
  "parents": [
           parents Resource
     ],
  "downloadUrl": string,
  "exportLinks": {
  (key): string
    },
  "indexableText": {
  "text": string
    },
  "userPermission": permissions Resource,
  "originalFilename": string,
  "fileExtension": string,
  "md5Checksum": string,
  "fileSize": long,
  "quotaBytesUsed": long,
  "ownerNames": [
        string
   ],
  "lastModifyingUserName": string,
  "editable": boolean,
  "writersCanShare": boolean,
  "explicitlyTrashed": boolean,
  "imageMediaMetadata": {
      "width": integer,
      "height": integer,
      "rotation": integer,
   "location": {
       "latitude": double,
       "longitude": double,
       "altitude": double
      }
    }
 }

“userPermission”字段是您可以找到答案的字段。

于 2012-09-20T01:35:21.477 回答