How to get information about files in Purview reviewsets?

dev 10 Reputation points
2024-03-26T00:04:14.1033333+00:00

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.
12,467 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.
1,261 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pauline Mbabu 560 Reputation points Microsoft Employee
    2024-03-27T09:59:12.9533333+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.