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

Viewed 55
var queryOptionsN = new List<QueryOption>()
{
    new QueryOption("format", "application/json"),
};
var unsortedUsersCollection = graphServiceClient.Reports.GetOneDriveUsageAccountDetail("D180").Request(queryOptionsN).GetAsync().Result;

Throws the exception:

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

Looks like an exception during deserialization of the response in Graph API SDK.

You can try a workaround when you create a http request and read the response as a json string.

var message = graphServiceClient.Reports.GetOneDriveUsageAccountDetail("D180")
                             .Request(queryOptionsN)
                             .GetHttpRequestMessage();
var response = await client.HttpProvider.SendAsync(message);
// Download report data - content should be json
var content = await response.Content.ReadAsStringAsync();

Similar for GetSharePointSiteUsageDetail.

Related