How to get information about files in Purview reviewsets?

dev 10 Reputation points

The reviewset objects contain no information about the number of files and size of files in the reviewset when this is available through the web app for purview.

I tried using the List reviewSet files endpoint with a $count parameter which resulted in a bad request.

Is there any way to get the total number of files and size without having to iterate through all the files and count/add up individual sizes?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,447 questions
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
915 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pauline Mbabu 5 Reputation points Microsoft Employee

    It looks like there isn't a direct way via Graph API to fetch the total number of files and total size in Purview without having to iterate through the Json array and summing up the individual sizes.

    The Microsoft Graph API does not currently support the $count query parameter for the List reviewSet files endpoint. Adding a $count parameter to this endpoint results in a bad request, as you've experienced.

    If you want to count the number of files and calculate the total size, you'll need to loop over the response from the API and perform these calculations manually. However, depending on the language you are using there would be an inbuilt function that can help with iterating over the response.