reportRoot: getSharePointSiteUsageStoragereportRoot: getSharePointSiteUsageStorage

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

获取报表周期内分配和使用的存储趋势。Get the trend of storage allocated and consumed during the reporting period.

注意: 若要详细了解不同的报表视图和名称,请参阅 Microsoft 365 报表-SharePoint 网站使用情况Note: For details about different report views and names, see Microsoft 365 reports - SharePoint site usage.

权限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) Reports.Read.AllReports.Read.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用Application Reports.Read.AllReports.Read.All

注意:若要获得委派权限以允许应用代表用户读取服务使用情况报告,租户管理员必须事先为用户分配适当的 Azure AD 受限管理员角色。Note: For delegated permissions to allow apps to read service usage reports on behalf of a user, the tenant administrator must have assigned the user the appropriate Azure AD limited administrator role. 有关更多详细信息,请参阅授权 API 读取 Microsoft 365 使用情况报告For more details, see Authorization for APIs to read Microsoft 365 usage reports.

HTTP 请求HTTP request

GET /reports/getSharePointSiteUsageStorage(period='{period_value}')

函数参数Function parameters

在请求 URL 中,提供以下参数的有效值。In the request URL, provide the following parameter with a valid value.

参数Parameter 类型Type 说明Description
periodperiod stringstring 指定在多长时间内聚合报表。Specifies the length of time over which the report is aggregated. 受支持的 {period_value} 值为:D7、D30、D90 和 D180。The supported values for {period_value} are: D7, D30, D90, and D180. 这些值采用格式 Dn,其中 n 表示在多少天内聚合报表。These values follow the format Dn where n represents the number of days over which the report is aggregated. 必需。Required.

请求标头Request headers

名称Name 说明Description
AuthorizationAuthorization 持有者{令牌}。必需。Bearer {token}. Required.
If-None-MatchIf-None-Match 如果包含此请求头,且提供的 eTag 与文件中的当前标记一致,返回的是 304 Not Modified 响应代码。If this request header is included and the eTag provided matches the current tag on the file, a 304 Not Modified response code is returned. 可选。Optional.

响应Response

如果成功,此方法返回 302 Found 响应,以重定向到报表的预先验证的下载 URL。If successful, this method returns a 302 Found response that redirects to a preauthenticated download URL for the report. 可以在响应的 Location 头中找到此 URL。That URL can be found in the Location header in the response.

预先验证的下载 URL 的有效时间很短(几分钟),不需要 Authorization 头。Preauthenticated download URLs are only valid for a short period of time (a few minutes) and do not require an Authorization header.

CSV 文件包含下面的列标题。The CSV file has the following headers for columns.

  • 报表刷新日期Report Refresh Date
  • 网站类型Site Type
  • 已使用的存储(字节)Storage Used (Byte)
  • 报表日期Report Date
  • 报表周期Report Period

示例Example

请求Request

下面展示了示例请求。The following is an example of the request.

GET https://graph.microsoft.com/v1.0/reports/getSharePointSiteUsageStorage(period='D7')

响应Response

下面展示了示例响应。The following is an example of the response.

HTTP/1.1 302 Found
Content-Type: text/plain
Location: https://reports.office.com/data/download/JDFKdf2_eJXKS034dbc7e0t__XDe

执行 302 重定向,下载的 CSV 文件将采用以下架构。Follow the 302 redirection and the CSV file that downloads will have the following schema.

HTTP/1.1 200 OK
Content-Type: application/octet-stream

Report Refresh Date,Site Type,Storage Used (Byte),Report Date,Report Period