SharePoint 2013 REST API - Post SocialRestPostCreationData
SharePoint 2013 REST API - Post SocialRestPostCreationData
我目前正在开发一个小型应用程序,使用 Social.Feed API.
将 Post 推送到 SharePoint 2013 SiteFeed
使用以下 JSON 对象结构的基本 Post 工作正常,但我正在努力使用社交依恋。
只要我引用的是位于互联网某处的文件,一切正常。 Posts 将使用对文件的 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,
}
}
};
是否可以改用本地文件? - 删除 google 路径并在 ContentUri 中使用本地路径将导致 BAD-Request 错误。
我想文件必须先以某种方式上传。
谢谢你的帮助。
壹岐
经过一些尝试,我们现在得出以下解决方案。
在我们创建 SocialPost 之前,我们将图片上传到所有 Feed 用户都可以访问的图库中。
然后我们创建包含link的post图像
-> 这样就可以了。
我目前正在开发一个小型应用程序,使用 Social.Feed API.
将 Post 推送到 SharePoint 2013 SiteFeed使用以下 JSON 对象结构的基本 Post 工作正常,但我正在努力使用社交依恋。
只要我引用的是位于互联网某处的文件,一切正常。 Posts 将使用对文件的 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,
}
}
};
是否可以改用本地文件? - 删除 google 路径并在 ContentUri 中使用本地路径将导致 BAD-Request 错误。
我想文件必须先以某种方式上传。
谢谢你的帮助。
壹岐
经过一些尝试,我们现在得出以下解决方案。
在我们创建 SocialPost 之前,我们将图片上传到所有 Feed 用户都可以访问的图库中。
然后我们创建包含link的post图像
-> 这样就可以了。