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.