【发布时间】:2014-05-17 11:46:03
【问题描述】:
我正在尝试使用 REST API 以编程方式创建网站栏和内容类型。在我尝试将我的网站栏与我的内容类型相关联之前,一切正常。
到目前为止,在我的代码中,网站栏和内容类型已经存在...
我正在向以下 URL 发送 POST...
http://mydevmachine/sites/claimsreports/_api/web/ContentTypes('0x01003E9D5AD94A5DCD46876B7BFFCEA9B60C')/FieldLinks
这是我在请求正文中发送的信息...
{
"__metadata": {
"type": "SP.FieldLink"
},
"Id": "9400d057-ba2c-4ab4-9ce0-671b858fd849",
"Name": "BusinessCategory",
"Hidden": false,
"Required": false
}
这是我回复的错误...
{"error":{"code":"-2147467261, System.ArgumentNullException","message":{"lang":"en-US","value":"Value cannot be null.\r\nParameter name: parameters"}}}
我尝试了其他几个选项,但均未成功。例如,我尝试使用 "__metadata" : { "type": "SP.FieldLinkCreationInformation"} 但我尝试使用此 __metadata 类型的所有操作都会导致此错误...
{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"A type named 'SP.FieldLinkCreationInformation' could not be resolved by the model. When a model is available, each type name must resolve to a valid type."}}}
听起来 SharePoint 告诉我此“类型”无效。 SharePoint 2013 似乎应该可以做到这一点,因为文档似乎暗示它可能......
如果有人有任何想法,我将不胜感激。谢谢!
【问题讨论】:
标签: rest sharepoint sharepoint-2013