Drive API v2 与 v3 比较参考文档

本参考文档介绍了 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.getfields='appProperties'
;公开:files.getfields='properties'
properties.insert 私享:files.update{'appProperties':{'key':'value'}}
;公开:files.update{'properties':{'key':'value'}}
properties.list 私享:files.getfields='appProperties'
;公开:files.getfields='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 maxImportSizesmaxUploadSize
About name user.displayName
About permissionId user.permissionId
About quotaBytesByService 不适用
About quotaType 根据是否存在 storageQuota.limit 指示
About remainingChangeIds 不适用
About rootFolderId files.getfileId=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 ownedByMecapabilities.canEditcapabilities.canComment
Files webViewLink 不适用
Permissions additionalRoles role
Permissions authKey
Permissions etag
Permissions name displayName
Permissions selfLink 不适用
Permissions value emailAddressdomain
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