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

OneDrive报表API:period参数失效但date参数正常问题

Troubleshooting Empty Response for getOneDriveUsageAccountDetail with period Parameter

I've run into a similar issue with the Microsoft Graph Beta API before, let's break down what's happening and how to address it:

Problem Overview

  • When calling the API with the period parameter (D30 for last 30 days):
    GET https://graph.microsoft.com/beta/reports/getOneDriveUsageAccountDetail(period='D30')?$format=application%2fjson
    
    The response returns an empty array:
    { "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(oneDriveUsageAccountDetail)", "value": [] }
    
  • However, using the date parameter to specify a single day (e.g., 2020-10-05):
    GET https://graph.microsoft.com/beta/reports/getOneDriveUsageAccountDetail(date=2020-10-05)?$format=application/json
    
    Returns valid data including the @odata.nextLink and populated value array as expected.

Possible Causes

  • Report Data Latency: Period-based aggregation reports (like D30) often have longer generation and sync times compared to single-date reports. It's possible the 30-day aggregated data hasn't been processed and made available in the Graph system yet.
  • Permission or Tenant-Specific Restrictions: Even with the required Reports.Read.All permission, some tenant configurations might restrict access to period-based usage reports, while allowing single-date data retrieval.
  • Beta API Limitations: Since this is a Beta endpoint, the period parameter implementation might be incomplete or have bugs that affect certain tenants (e.g., commercial vs. education tenants).
  • Wait for Data Sync: Give the system 24-48 hours to generate and sync the 30-day aggregated report, then retry the request.
  • Double-Check Permissions: Confirm your application or user account has been granted the Reports.Read.All delegated or application permission, and that there are no tenant-level policies blocking access to period-based reports.
  • Workaround with date Parameter: If the period parameter remains unresponsive, iterate over each date in the 30-day window using the date parameter, then aggregate the results locally. This ensures you get reliable data even if the period endpoint is broken.
  • Report the Bug: If you've ruled out latency and permission issues, submit feedback to Microsoft via their Graph API feedback channel—Beta endpoints rely on user input to fix such inconsistencies.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.09 14:12:48