【发布时间】:2021-08-17 04:57:39
【问题描述】:
我正在尝试从 google drive api 获取文件的资源密钥
在google api的描述中 9 月 13 日,他们将更新文件许可 他们说 '您必须更新访问文件的代码以包含适当的资源键' '在 Drive API 响应中文件元数据的 resourceKey 字段中返回项目的资源密钥'
但是当我尝试获取文件时,我无法从文件元数据的字段中找到资源键 而且当我尝试在google api测试中进行时,响应也没有资源键 下面是api测试的结果
{
"kind": "drive#file",
"id": "1iLXfgFeTJi5Fhv",
"etag": "\"MTYyODc0MTU1ODg4Nw\"",
"selfLink": "https://www.googleapis.com/drive/v2/files/1iLXfgFeTJi5Fhv",
"alternateLink": "https://docs.google.com/spreadsheets/d/1iLXfgFeTJi5Fhv/edit?usp=drivesdk",
"embedLink": "https://docs.google.com/spreadsheets/d/1iLXfgFeTJi5Fhv",
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.spreadsheet",
"thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&id=1iLXfgFeTJi5Fhv&v=3&s=AMedNnoAAAAAYRtUMTI6h451YaMRq96KNGUB_WwYBPDv&sz=s220",
"title": "CSS_v1_212232173224",
"mimeType": "application/vnd.google-apps.spreadsheet",
"labels": {
"starred": false,
"hidden": false,
"trashed": false,
"restricted": false,
"viewed": true
},
"copyRequiresWriterPermission": false,
"createdDate": "2021-08-12T04:10:07.115Z",
"modifiedDate": "2021-08-12T04:12:38.887Z",
"lastViewedByMeDate": "2021-08-17T04:16:16.628Z",
"markedViewedByMeDate": "1970-01-01T00:00:00.000Z",
"sharedWithMeDate": "2021-08-17T04:16:16.628Z",
"version": "10",
"parents": [],
"exportLinks": {
"application/x-vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv",
"text/tab-separated-values": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv&exportFormat=tsv",
"application/pdf": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv&exportFormat=pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv4&exportFormat=xlsx",
"text/csv": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv&exportFormat=csv",
"application/zip": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv&exportFormat=zip",
"application/vnd.oasis.opendocument.spreadsheet": "https://docs.google.com/spreadsheets/export?id=1iLXfgFeTJi5Fhv&exportFormat=ods"
},
"userPermission": {
"kind": "drive#permission",
"etag": "\"kKO0QvvB0TR5MI4KTDoDeWQE7AU\"",
"id": "me",
"selfLink": "https://www.googleapis.com/drive/v2/files/1iLXfgFeTJi5Fhv/permissions/me",
"role": "reader",
"type": "user"
},
"fileSize": "13706",
"quotaBytesUsed": "13706",
"ownerNames": [
""
],
"owners": [
{
"kind": "drive#user",
"displayName": "",
"isAuthenticatedUser": false,
"permissionId": "",
"emailAddress": ""
}
],
"lastModifyingUserName": "",
"lastModifyingUser": {
"kind": "drive#user",
"displayName": "",
"isAuthenticatedUser": false,
"permissionId": "",
"emailAddress": ""
},
"capabilities": {
"canCopy": true,
"canEdit": false
},
"editable": false,
"copyable": true,
"writersCanShare": true,
"shared": true,
"explicitlyTrashed": false,
"appDataContents": false,
"spaces": [
"drive"
]
}
我怎样才能得到文件的resourcekey??
【问题讨论】:
-
我无法让它工作,或者我已经在 google 上 ping 了某人,当我听到什么时会回复你。
标签: google-drive-api