Google api 检索Google共享驱动器文件夹的web视图链接
我正在尝试让谷歌的webviewlink共享 API: 我无法获取特定共享驱动器文件夹的webviewlink 我的输入将是文件夹id:Google api 检索Google共享驱动器文件夹的web视图链接,google-api,google-drive-api,Google Api,Google Drive Api,我正在尝试让谷歌的webviewlink共享 API: 我无法获取特定共享驱动器文件夹的webviewlink 我的输入将是文件夹id: { "id": "1Vat7pdwnpg8i2xMzhic4dOVbadZNv0OJ" } 我怎样才能做到这一点呢?在看不到您提出的确切要求的情况下,很难提供帮助,但我可以说,这一点很好。我可以获取与我共享的google drive目录的记录,该目录包含一个web视图链接,该链接与我发送的文件id相同 要求 响应
{
"id": "1Vat7pdwnpg8i2xMzhic4dOVbadZNv0OJ"
}
我怎样才能做到这一点呢?在看不到您提出的确切要求的情况下,很难提供帮助,但我可以说,这一点很好。我可以获取与我共享的google drive目录的记录,该目录包含一个web视图链接,该链接与我发送的文件id相同 要求 响应 此请求的web视图链接与我发送的文件id相同
文件ID会随着web视图链接的变化而变化,并且它们可能不同步。您现在得到的响应是什么?它是什么类型的文件?并非所有文件类型都创建web链接。我只获取子文件夹的详细信息。例如,“名称”:“谷歌硬盘、笔记和附件”、“家长”:[“1Vat7pdwnpg8i2xMzhic4dOVbadZNv0OJ”],“webViewLink”:“但我需要webViewLink传递的文件夹id。”
curl \
'https://www.googleapis.com/drive/v3/files/1nhladm_nRRee6rVER9ZA5QqnyKwfG7l?fields=*&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
{
"kind": "drive#file",
"id": "1nhladm_nRRee6rVER9ZA5QqnyKwfG7l",
"name": "ML GDE Model Deployment Project",
"mimeType": "application/vnd.google-apps.folder",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"parents": [
"1OYYiVmqFp9ZvuRSuVgC_ihkdYirLnu"
],
"spaces": [
"drive"
],
"version": "461",
"webViewLink": "https://drive.google.com/drive/folders/1nhladm_nRRee6rVER9ZA5QqnyKwfG7li",
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.folder+shared",
"hasThumbnail": false,
"thumbnailVersion": "0",
"viewedByMe": false,
"createdTime": "2020-04-02T04:21:47.275Z",
"modifiedTime": "2020-11-02T13:58:51.042Z",
"modifiedByMe": false,
"owners": [
{
.....
}
],
"lastModifyingUser": {
"kind": "drive#user",
},
"shared": true,
"ownedByMe": false,
"capabilities": {
"canAddChildren": false,
"canAddMyDriveParent": false,
"canChangeCopyRequiresWriterPermission": false,
"canChangeViewersCanCopyContent": false,
"canComment": false,
"canCopy": false,
"canDelete": false,
"canDownload": true,
"canEdit": false,
"canListChildren": true,
"canModifyContent": false,
"canMoveChildrenWithinDrive": false,
"canMoveItemIntoTeamDrive": false,
"canMoveItemOutOfDrive": false,
"canMoveItemWithinDrive": false,
"canReadRevisions": false,
"canRemoveChildren": false,
"canRemoveMyDriveParent": true,
"canRename": false,
"canShare": false,
"canTrash": false,
"canUntrash": false
},
"viewersCanCopyContent": true,
"copyRequiresWriterPermission": false,
"writersCanShare": true,
"folderColorRgb": "#8f8f8f",
"quotaBytesUsed": "0",
"isAppAuthorized": false
}