Looking to fetch Activity data for a few dozen SharePoint sites through the Graph API and hitting a bit of a snag. The response I always get to a simple "" call seems to have the "timeSpentinSeconds" values (even though these aren't mentioned in the documentation). I'd need the data broken down by the hourly level, rather than using the "analytics" endpoint, which gives you a choice of Last7Days / AllTime. Any ideas why this is happening?
Sample response received:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(itemActivityStat)",
"value": [
{
"@odata.type": "#microsoft.graph.itemActivityStat",
"aggregationInterval": "None",
"startDateTime": "2023-10-09T00:00:00Z",
"endDateTime": "2023-10-09T00:59:59Z",
"access": {
"actionCount": 4,
"actorCount": 1,
"timeSpentInSeconds": 0
},
"incompleteData": {
"wasThrottled": false,
"resultsPending": false,
"notSupported": false
}
},
{
"@odata.type": "#microsoft.graph.itemActivityStat",
"aggregationInterval": "None",
"startDateTime": "2023-10-09T01:00:00Z",
"endDateTime": "2023-10-09T01:59:59Z",
"access": {
"actionCount": 7,
"actorCount": 3,
"timeSpentInSeconds": 0
},
"incompleteData": {
"wasThrottled": false,
"resultsPending": false,
"notSupported": false
}
},
...
...
...
{
"@odata.type": "#microsoft.graph.itemActivityStat",
"aggregationInterval": "None",
"startDateTime": "2023-10-10T22:00:00Z",
"endDateTime": "2023-10-10T22:59:59Z",
"access": {
"actionCount": 15,
"actorCount": 2,
"timeSpentInSeconds": 0
},
"incompleteData": {
"wasThrottled": false,
"resultsPending": false,
"notSupported": false
}
},
{
"@odata.type": "#microsoft.graph.itemActivityStat",
"aggregationInterval": "None",
"startDateTime": "2023-10-10T23:00:00Z",
"endDateTime": "2023-10-10T23:59:59Z",
"access": {
"actionCount": 3,
"actorCount": 1,
"timeSpentInSeconds": 0
},
"incompleteData": {
"wasThrottled": false,
"resultsPending": false,
"notSupported": false
}
}
]
}