列出最近使用的文件List recent files

命名空间:microsoft.graphNamespace: microsoft.graph

列出已登录用户最近使用的一组项目。此集合包含用户驱动器中的项目,以及他们有从其他驱动器进行访问的权限的项目。List a set of items that have been recently used by the signed in user. This collection includes items that are in the user's drive as well as items they have access to from other drives.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) Files.Read、Files.ReadWrite、Files.Read.All、Files.ReadWrite.All、Sites.Read.All、Sites.ReadWrite.AllFiles.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) Files.Read、Files.ReadWrite、Files.Read.All、Files.ReadWrite.AllFiles.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All
应用程序Application Files.Read.All、Files.ReadWrite.All、Sites.Read.All、Sites.ReadWrite.AllFiles.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All

HTTP 请求HTTP request

GET /me/drive/recent

响应Response

此方法返回驱动器所有者最近访问的项的 DriveItem 资源集合。This method returns a collection of DriveItem resources for items which the owner of the drive has recently accessed.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "value": [
    {
      "id": "1312abc!1231",
      "remoteItem":
      {
        "id": "1991210caf!192",
        "name": "March Proposal.docx",
        "file": { },
        "size": 19121,
        "parentReference": {
          "driveId": "1991210caf",
          "id": "1991210caf!104"
        }
      },
      "fileSystemInfo": {
        "lastAccessedDateTime": "2017-02-20T19:13:00Z"
      }
    },
    {
      "id": "1312def!9943",
      "name": "Vacation.jpg",
      "file": { },
      "size": 37810,
      "parentReference": {
        "driveId": "1312def",
        "id": "1312def!123"
      },
      "fileSystemInfo": {
        "lastAccessedDateTime": "2017-02-20T16:43:21Z"
      }
    }
  ]
}

注解Remarks

最近操作返回的部分 driveItem 将包括 remoteItem 方面,这表明它们是其他驱动器中的项目。若要访问原始的 driveItem 对象,你将需要使用 remoteItem 中提供的信息发出请求,信息格式如下:Some driveItems returned from the recent action will include the remoteItem facet which indicates they are items from another drive. To access the original driveItem object, you will need to make a request using the information provided in remoteItem in the following format:

GET /drives/{remoteItem-driveId}/items/{remoteItem-id}