我正在尝试使用 Microsoft Graph 创建新的 SharePoint ListItem。
要创建包含标题等简单字段的列表项,我的 POST 正文如下所示:
{
"fields":{
"Title":"Ehsan's REST"
}
}
但是一旦我添加一个具有多选值的字段,我就会得到The request is malformed or incorrect.
error.
example:
{
"fields":{
"Title":"Ehsan's REST",
"Languages": ["English","French"]
}
}
在我的搜索过程中我发现这个论坛帖子 https://social.msdn.microsoft.com/Forums/office/en-US/6b460946-b2f6-45a1-97e9-2d7bd2d3395d/sample-json-to-set-values-in-a-multichoice-field-using-rest?forum=sharepointdevelopment其中 SharePoint API(不是 Graph )需要将元数据属性作为对象添加到集合中:
"InternalFieldName":{
"__metadata":{"type":"Collection(Edm.String)"},
"results":["Value1","Value2","Value3"]
}
有一个悬而未决的问题在 microsoft graph doc github 上 https://github.com/microsoftgraph/microsoft-graph-docs/issues/1965也与此相关。
有什么建议么?