无法通过 SharePoint Microsoft Graph 更新超链接或图片



我正在尝试更新列表项上的值(类型为超链接或图片(。执行 GET 请求时,数据返回正常,但是当我尝试创建一个项目或使用值 udpate 时,我最终得到以下内容:

{
    "error": {
        "code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
        "message": "A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value.",
        "innerError": {
            "request-id": "d12dfb12-a068-4621-9f27-d284e4635060",
            "date": "2019-05-28T08:52:51"
        }
    }
}

开机自检/补丁请求将转到:

https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/

并包含一个简单的JSON(在PATCH的情况下(:

{
  "WebPage":
  {
    "Description": "Microsoft Graph",
    "Url": "http://graph.microsoft.com"
  }
}

知道我做错了什么吗?我尝试使用 .NET SDK 和图形资源管理器,它以相同的错误结束......

对于列表中项目的更新,您需要提供 ID 作为 URI 的一部分,它应如下所示:

PATCH https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}

你收到的错误是尝试使用 Graph 无法与该集合协调的对象更新集合时返回的错误。

最新更新