Get analytics
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Get itemAnalytics about the views that took place under this resource.
The itemAnalytics resource is a convenient way to get activity stats for allTime
and the lastSevenDays
.
For a custom time range or interval, use the getActivitiesByInterval API.
Note: The itemAnalytics resource is not yet available in all national deployments.
Permissions
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.All |
Delegated (personal Microsoft account) | Not supported. |
Application | Files.Read.All, Files.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
HTTP request
GET /drives/{drive-id}/items/{item-id}/analytics
GET /sites/{site-id}/analytics
GET /sites/{site-id}/lists/{list-id}/items/{item-id}/analytics
Optional query parameters
This method supports the OData query parameters to help customize the response.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of itemAnalytics objects in the response body.
Example
Request
The following is an example of a request.
GET /drives/{drive-id}/items/{item-id}/analytics
Response
The following is an example of the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"allTime": {
"access": {
"actionCount": 123,
"actorCount": 89
}
},
"lastSevenDays": {
"access": {
"actionCount": 52,
"actorCount": 41
}
}
}
Feedback
Submit and view feedback for