本参考文档介绍了 v2 与 v3 在资源方面的所有差异。对于 两个版本之间的区别,请参阅 Drive API v2 和 v3 比较指南中所述。
v2 与 v3 之间的方法差异
此表显示了 v3 中已更改的 v2 方法。
v2 方法 | v3 方法 |
---|---|
children.delete |
针对孩子 (?removeParents=parent_id ) files.update |
children.get |
files.list 与 ?q='parent_id'+in+parents 合作 |
children.insert |
针对孩子 (?addParents=parent_id ) files.update |
children.list |
files.list 与 ?q='parent_id'+in+parents 合作 |
comments.insert |
comments.create |
comments.patch |
comments.update |
files.insert |
files.create |
files.patch |
files.update |
files.touch |
files.update 与 {'modifiedTime':'timestamp'} 合作 |
files.trash |
files.update 与 {'trashed':true} 合作 |
files.untrash |
files.update 与 {'trashed':false} 合作 |
parents.delete |
files.update 与 ?removeParents=parent_id 合作 |
parents.get |
files.get 与 ?fields=parents 合作 |
parents.insert |
files.update 与 ?addParents=parent_id 合作 |
parents.list |
files.get 与 ?fields=parents 合作 |
permissions.getIdForEmail |
不适用 |
permissions.insert |
permissions.create |
permissions.patch |
permissions.update |
properties.delete |
私享:files.update ,{'appProperties':{'key':null}} 公开: files.update ,{'properties':{'key':null}} |
properties.get |
私享:files.get ,fields='appProperties' ;公开: files.get ,fields='properties' |
properties.insert |
私享:files.update ,{'appProperties':{'key':'value'}} ;公开: files.update ,{'properties':{'key':'value'}} |
properties.list |
私享:files.get ,fields='appProperties' ;公开: files.get ,fields='properties' |
properties.update |
私享:files.update ,{'appProperties':{'key':'value'}} ;公开: files.update ,{'properties':{'key':'value'}} |
replies.insert |
replies.create |
replies.patch |
replies.update |
revisions.patch |
revisions.update |
v2 与 v3 之间的参数差异
下表显示的方法在 v2 和 v3 中相同,但采用的参数不同。
方法 | v2 参数 | v3 参数 |
---|---|---|
about.get |
includeSubscribed |
不适用 |
about.get |
maxChangeIdCount |
无 |
about.get |
startChangeId |
无 |
changes.list |
includeDeleted |
includeRemoved |
changes.list |
includeSubscribed=true |
restrictToMyDrive=false |
changes.list |
includeSubscribed=false |
restrictToMyDrive=true |
changes.list |
maxResults |
pageSize |
changes.list |
startChangeId |
pageToken |
changes.list |
etag |
无 |
changes.list |
items |
changes |
changes.list |
largestChangeId |
newStartPageToken |
changes.list |
nextLink |
nextPageToken |
changes.list |
selfLink |
无 |
comments.list |
maxResults |
pageSize |
comments.list |
updatedMin |
startModifiedTime |
comments.list |
nextLink |
nextPageToken |
comments.list |
selfLink |
不适用 |
comments.list |
items |
comments |
files.copy |
convert |
在资源正文中提供目标 mimeType |
files.copy |
ocr |
自动为图片导入启用 OCR |
files.copy |
pinned |
keepRevisionForever |
files.copy |
timedTextLanguage |
不适用 |
files.copy |
timedTextTrackName |
不适用 |
files.copy |
visibility=DEFAULT |
ignoreDefaultVisibility=false |
files.copy |
visibility=PRIVATE |
ignoreDefaultVisibility=true |
files.insert |
convert |
在资源正文中提供目标 mimeType |
files.insert |
ocr |
自动为图片导入启用 OCR |
files.insert |
pinned |
keepRevisionForever |
files.insert |
timedTextLanguage |
不适用 |
files.insert |
timedTextTrackName |
无 |
files.insert |
visibility=DEFAULT |
ignoreDefaultVisibility=false |
files.insert |
visibility=PRIVATE |
ignoreDefaultVisibility=true |
files.get |
projection |
不适用 |
files.get |
revisionId |
revisions.get |
files.get |
updateViewedDate |
files.update 与 {'viewedByMeTime':'timestamp'} 合作 |
files.generateIds |
maxResults |
count |
files.list |
corpora=default |
corpus=user |
files.list |
corpora=domain |
corpus=domain |
files.list |
maxResults |
pageSize |
files.list |
etag |
不适用 |
files.list |
items |
files |
files.list |
nextLink |
nextPageToken |
files.list |
selfLink |
不适用 |
files.update |
modifiedDateBehavior |
如果资源正文中未提供修改日期,系统会自动设置修改日期。 |
files.update |
newRevision |
不适用 |
files.update |
ocr |
自动为图片导入启用 OCR |
files.update |
pinned |
keepRevisionForever |
files.update |
setModifiedDate |
不适用 |
files.update |
timedTextLanguage |
无 |
files.update |
timedTextTrackName |
不适用 |
files.update |
updateViewedDate |
files.update 与 {'viewedByMeTime':'timestamp'} 合作 |
permissions.insert |
sendNotificationEmails |
sendNotificationEmail |
permissions.list |
etag |
不适用 |
permissions.list |
items |
permissions |
permissions.list |
selfLink |
无 |
replies.list |
maxResults |
pageSize |
replies.list |
items |
replies |
replies.list |
nextLink |
nextPageToken |
replies.list |
selfLink |
无 |
revisions.list |
etag |
无 |
revisions.list |
items |
revisions |
revisions.list |
selfLink |
不适用 |
v2 与 v3 之间的资源字段差异
此表显示了从 v2 更改为 v3 的资源字段。
资源 | v2 Field |
v3 Field |
---|---|---|
About |
additionalRoleInfo |
不适用 |
About |
domainSharingPolicy |
无 |
About |
etag |
无 |
About |
features |
无 |
About |
languageCode |
不适用 |
About |
largestChangeId |
changes.getStartPageToken |
About |
maxUploadSizes |
maxImportSizes 和maxUploadSize |
About |
name |
user.displayName |
About |
permissionId |
user.permissionId |
About |
quotaBytesByService |
不适用 |
About |
quotaType |
根据是否存在 storageQuota.limit 指示 |
About |
remainingChangeIds |
不适用 |
About |
rootFolderId |
files.get ,fileId=root 和?fields=id |
About |
selfLink |
不适用 |
About |
isCurrentAppInstalled |
appInstalled |
About |
quotaBytesTotal |
storageQuota.limit |
About |
quotaBytesUsed |
storageQuota.usageInDrive |
About |
quotaBytesUsedAggregate |
storageQuota.usage |
About |
quotaBytesUsedInTrash |
storageQuota.usageInDriveTrash |
Apps |
etag |
无 |
Changes |
deleted |
removed |
Changes |
id |
无 |
Changes |
selfLink |
无 |
Changes |
modificationDate |
time |
Comments |
context.type |
quotedFileContent.mimeType |
Comments |
context.value |
quotedFileContent.value |
Comments |
createdDate |
createdTime |
Comments |
fileId |
不适用 |
Comments |
fileTitle |
files.get 与 ?fields=name 合作 |
Comments |
modifiedDate |
modifiedTime |
Comments |
selfLink |
不适用 |
Comments |
status |
resolved |
Files |
alternateLink |
webViewLink |
Files |
appDataContents |
spaces |
Files |
copyable |
capabilities.canCopy |
Files |
createdDate |
createdTime |
Files |
defaultOpenWithLink |
不适用 |
Files |
downloadUrl |
files.get 与 ?alt=media 合作 |
Files |
editable |
capabilities.canEdit |
Files |
embedLink |
不适用 |
Files |
etag |
无 |
Files |
fileSize |
size |
Files |
imageMediaMetadata.date |
imageMediaMetadata.time |
Files |
indexableText.text |
contentHints.indexableText |
Files |
copyRequiresWriterPermission |
viewersCanCopyContent |
Files |
labels.starred |
starred |
Files |
labels.trashed |
trashed |
Files |
labels.viewed |
viewedByMe |
Files |
lastModifyingUserName |
lastModifyingUser.displayName |
Files |
lastViewedByMeDate |
viewedByMeTime |
Files |
modifiedByMeDate |
modifiedByMeTime |
Files |
modifiedDate |
modifiedTime |
Files |
openWithLinks |
无 |
Files |
ownerNames |
owners.displayName |
Files |
selfLink |
不适用 |
Files |
sharedWithMeDate |
sharedWithMeTime |
Files |
thumbnail.image |
contentHints.thumbnail.image |
Files |
thumbnail.mimeType |
contentHints.thumbnail.mimeType |
Files |
title |
name |
Files |
userPermission |
ownedByMe 、capabilities.canEdit 、capabilities.canComment |
Files |
webViewLink |
不适用 |
Permissions |
additionalRoles |
role |
Permissions |
authKey |
无 |
Permissions |
etag |
无 |
Permissions |
name |
displayName |
Permissions |
selfLink |
不适用 |
Permissions |
value |
emailAddress 或 domain |
Permissions |
withLink=true |
allowFileDiscovery=false |
Permissions |
withLink=false |
allowFileDiscovery=true |
Replies |
createdDate |
createdTime |
Replies |
modifiedDate |
modifiedTime |
Replies |
replyId |
id |
Replies |
verb |
action |
Revisions |
downloadUrl |
revisions.get 与 ?alt=media 合作 |
Revisions |
etag |
不适用 |
Revisions |
fileSize |
size |
Revisions |
lastModifyingUserName |
lastModifyingUser.displayName |
Revisions |
modifiedDate |
modifiedTime |
Revisions |
pinned |
keepForever |
Revisions |
publishedLink |
无 |
Revisions |
selfLink |
无 |
Revisions |
isAuthenticatedUser |
me |
Revisions |
lastModifyingUser.picture.url |
photoLink |