[英]Error 403 during POST on SharePoint 2013 REST API [on premise]
[英]SharePoint 2013 REST API - Post SocialRestPostCreationData
我目前正在开发一个小型应用程序,以使用Social.Feed API将Post推送到SharePoint 2013 SiteFeed。
使用以下JSON对象结构的基本帖子工作正常,但我在使用社交附件时遇到了麻烦。
只要我指的是Internet上某处的文件,一切正常。 帖子将在HTTP引用文件的微型提要列表中创建列表项。 我正在使用的对象是这样设置的
var creationInfo = new
{
restCreationData = new
{
__metadata = new { type = "SP.Social.SocialRestPostCreationData" },
ID = array,
creationData = new
{
__metadata = new { type = "SP.Social.SocialPostCreationData" },
Attachment = new
{
__metadata = new { type = "SP.Social.SocialAttachment" },
AttachmentKind = 0,
ContentUri = "https://www.google.com/images/icons/hpcg/ribbon-black_68.png",
Description = "Look at this",
Name = "Test",
Uri = "https://www.google.com/images/icons/hpcg/ribbon-black_68.png"
},
ContentText = text,
UpdateStatusText = false,
}
}
};
是否可以使用本地文件? -在ContentUri中删除Google路径并使用本地路径将导致BAD-Request错误。
我想文件必须以某种方式上传。
感谢您的帮助。
壹岐
经过一番尝试,我们现在得出以下解决方案。
在创建SocialPost之前,我们将图片上传到所有Feed用户都可以访问的图片库中。
然后我们创建包含图像链接的帖子
->这样就可以了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.