GetOneDriveUsageAccountDetail() and GetSharePointSiteUsageDetail() not working for me v1.0

Anonymous
2022-05-25T07:38:08.6+00:00
var queryOptionsN = new List<QueryOption>()
{
     new QueryOption("format", "application/json"),
};
var unsortedUsersCollection = graphServiceClient.Reports.GetOneDriveUsageAccountDetail("D180").Request(queryOptionsN).GetAsync().Result;

InnerException = {"'R' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."}

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2022-05-26T07:08:17.33+00:00

    Hi anonymous user

    Indeed it appears to be a bug with de-serializing response payload.

    Try using this code snippet instead:

            var requestUrl = graphClient.Reports.GetOneDriveUsageAccountDetail("D180").Request().RequestUrl;  
            var request = new HttpRequestMessage(HttpMethod.Get, requestUrl);  
            await graphClient.AuthenticationProvider.AuthenticateRequestAsync(request);  
            var response = await graphClient.HttpProvider.SendAsync(request);  
    
            // Get the csv report data  
            var csvData = await response.Content.ReadAsStringAsync();  
    

    205697-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

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.