修订列表并获取缺失信息
Revisions list and get missing information
使用 Google APIs 资源管理器以及 Google Drive API v3 的官方 C# 库,响应缺少大部分 documented fields。我特别需要访问谁进行了修订,应该可以通过 $.lastModifyingUser
.
访问
我已经在我的域管理员帐户和服务帐户上试过了,所以它不应该是权限问题,至少我看不到。我做错了什么?
List:
{
"kind": "drive#revisionList",
"revisions": [
{
"kind": "drive#revision",
"id": "1",
"mimeType": "application/vnd.google-apps.spreadsheet",
"modifiedTime": "2016-11-16T18:29:29.527Z"
},
{
"kind": "drive#revision",
"id": "14",
"mimeType": "application/vnd.google-apps.spreadsheet",
"modifiedTime": "2016-11-16T18:35:49.184Z"
},
...
{
"kind": "drive#revision",
"id": "134088",
"mimeType": "application/vnd.google-apps.spreadsheet",
"modifiedTime": "2017-05-24T11:48:00.788Z"
}
您需要在请求中添加 fields="*"
或 fields="permissions(id,lastModifyingUser)"
以指示云端硬盘 return 完整资源。默认情况下,只有一小部分属性是 returned。
我无法从修订版 API 中检索到 "lastModifyingUser",但我能够从 Files.get 中检索到 "lastModifyingUser" 例如:
File foundFile = service.files().get(id)
.setSupportsTeamDrives(true)
.setFields("parents, webViewLink, properties, lastModifyingUser")
.execute();
System.out.println("Found file is " + foundFile);
System.out.println("Parents " + foundFile.getParents());
System.out.println("Owners " + foundFile.getOwners());
System.out.println("Props " + foundFile.getProperties());
System.out.println("Last user " + foundFile.getLastModifyingUser());
使用 Google APIs 资源管理器以及 Google Drive API v3 的官方 C# 库,响应缺少大部分 documented fields。我特别需要访问谁进行了修订,应该可以通过 $.lastModifyingUser
.
我已经在我的域管理员帐户和服务帐户上试过了,所以它不应该是权限问题,至少我看不到。我做错了什么?
List:
{
"kind": "drive#revisionList",
"revisions": [
{
"kind": "drive#revision",
"id": "1",
"mimeType": "application/vnd.google-apps.spreadsheet",
"modifiedTime": "2016-11-16T18:29:29.527Z"
},
{
"kind": "drive#revision",
"id": "14",
"mimeType": "application/vnd.google-apps.spreadsheet",
"modifiedTime": "2016-11-16T18:35:49.184Z"
},
...
{
"kind": "drive#revision",
"id": "134088",
"mimeType": "application/vnd.google-apps.spreadsheet",
"modifiedTime": "2017-05-24T11:48:00.788Z"
}
您需要在请求中添加 fields="*"
或 fields="permissions(id,lastModifyingUser)"
以指示云端硬盘 return 完整资源。默认情况下,只有一小部分属性是 returned。
我无法从修订版 API 中检索到 "lastModifyingUser",但我能够从 Files.get 中检索到 "lastModifyingUser" 例如:
File foundFile = service.files().get(id) .setSupportsTeamDrives(true) .setFields("parents, webViewLink, properties, lastModifyingUser") .execute(); System.out.println("Found file is " + foundFile); System.out.println("Parents " + foundFile.getParents()); System.out.println("Owners " + foundFile.getOwners()); System.out.println("Props " + foundFile.getProperties()); System.out.println("Last user " + foundFile.getLastModifyingUser());