You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于Microsoft Graph Recent API未返回LastAccessedDateTime的技术问询

Answers to Your Microsoft Graph Recent API Questions

Let's break down your questions one by one in a straightforward way:

1. Does the Microsoft Graph Recent API capture open events for read-only files?

Short answer: No, it doesn't.

The Recent API (/me/drive/recent) is built to track files you’ve actively interacted with—think actions like editing, uploading, sharing, or adding comments. Simply opening a read-only file to view it (without making changes or adding any other interactions) doesn’t count as an event that triggers the API to include the file in its results, nor does it update the lastAccessedDateTime field in the response. The API’s focus is on files you’ve "engaged with," not just passively viewed.

2. Alternative ways to get the lastAccessedDateTime property

Since the Recent API doesn’t return this field, here are reliable workarounds to retrieve it:

  • Fetch individual file details directly
    Use the Drive Item endpoint to pull full details for a specific file, explicitly requesting the fileSystemInfo property with the $select parameter:

    GET https://graph.microsoft.com/v1.0/me/drive/items/{file-id}?$select=fileSystemInfo
    

    A successful response will include the complete fileSystemInfo object:

    {
      "fileSystemInfo": {
        "createdDateTime": "2018-05-14T10:15:21Z",
        "lastModifiedDateTime": "2018-05-14T10:15:00Z",
        "lastAccessedDateTime": "2023-10-05T08:30:15Z"
      }
    }
    

    Note: You’ll need the target file’s ID (which you can grab from the Recent API’s results).

  • Use the Search API to retrieve multiple files with lastAccessedDateTime
    If you need this property for multiple files matching a query, use the search endpoint with $select:

    GET https://graph.microsoft.com/v1.0/me/drive/root/search(q='your-search-term')?$select=id,name,fileSystemInfo
    

    This returns a list of matching files, each including the full fileSystemInfo object.

  • Leverage Delta Query for ongoing access event tracking
    For continuous monitoring of file access events, use Delta Query to subscribe to drive changes. This lets you capture updates to lastAccessedDateTime as they occur, though it requires setting up a subscription and handling change notifications.

A quick heads-up: lastAccessedDateTime might have some latency in updating, and not all client applications trigger this field to sync (e.g., some older desktop apps might not push access times to OneDrive).

内容的提问来源于stack exchange,提问作者Dogu Arslan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 03:28:15