GetOneDriveUsageAccountDetail() 和 GetSharePointSiteUsageDetail() 在 C# 中对我 v1.0 不起作用

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

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."}

在 Graph API SDK 中反序列化响应期间似乎出现异常。

您可以在创建 http 请求并将响应读取为 json 字符串时尝试解决方法。

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();

类似于 GetSharePointSiteUsageDetail