SharePoint 的好友动态订阅源 REST API 引用Social feed REST API reference for SharePoint

查找 SharePoint REST 端点,以使用 SocialRestFeedManager 资源读取和写入到好友动态订阅源。 您可以使用 SharePoint 代表性状态传输 (REST) 服务来执行与 .NET 客户端对象模型和 JavaScript 对象模型相同的操作。REST 服务会公开 SharePoint 对象、属性和方法对应的资源。要使用 REST 服务,需构建 HTTP GETPOST 请求,并将其发送至表示您想要执行的任务的资源终结点。Find SharePoint REST endpoints for reading and writing to social feeds by using the SocialRestFeedManager resource. You can use the SharePoint Representational State Transfer (REST) service to do the same things that you can do with the .NET client object models and the JavaScript object model. The REST service exposes resources that correspond to SharePoint objects, properties, and methods. To use the REST service, you build and send HTTP GET and POST requests to the resource endpoints that represent the tasks you want to do.

大部分订阅源任务的终结点 URI 以 SocialRestFeedManager 资源 ( social.feed) 开头,后跟 my 资源或 post 资源:The endpoint URIs for most feed tasks begin with the SocialRestFeedManager resource ( social.feed), followed by the my resource or the post resource:

  • my 资源代表当前用户。在终结点 URI 中内嵌使用时,它会将请求的上下文设置为当前用户。例如, http://contoso.com/_api/social.feed/my/news 将获取当前用户的新闻源。The my resource represents the current user. When used inline in the endpoint URI, it sets the context of the request to the current user. For example, http://contoso.com/_api/social.feed/my/news gets the newsfeed for the current user.
  • post 资源代表特定的主题或文章。在终结点 URI 中内嵌使用时,它会将请求的上下文设置为指定主题或文章。例如, http://contoso.com/_api/social.feed/post/lock 会锁定指定主题。The post resource represents a specific thread or post. When used inline in the endpoint URI, it sets the context of the request to the specified thread or post. For example, http://contoso.com/_api/social.feed/post/lock locks the specified thread.

如果资源终结点接受某个参数,参数元数据将在 URI 或请求正文中指定。默认情况下,REST 服务将返回 Atom 协议格式的响应,但您可以使用 HTTP Accept 标头请求 JSON 格式。请参阅 订阅源任务的示例 REST 请求查看完整请求的示例。If the resource endpoint takes a parameter, the parameter metadata is specified in the URI or in the request body. By default, the REST service returns responses formatted in the Atom protocol, but you can request the JSON format by using HTTP Accept headers. See Example REST requests for feed tasks for examples of complete requests.

订阅源任务的资源终结点Resource endpoints for feed tasks

终结点Endpoint 说明Description
MyMy 获取有关当前用户的信息。Gets information about the current user.
My/Feed/PostMy/Feed/Post 在当前用户的订阅源中创建根文章。Creates a root post in the current user's feed.
My/FeedMy/Feed 获取当前用户的活动订阅源。Gets the feed of activity by the current user.
My/NewsMy/News 获取当前用户和好友的活动订阅源及用户关注的内容Gets the feed of activity by the current user and by people and content the user is following.
My/TimelineFeedMy/TimelineFeed 获取当前用户和好友的活动订阅源及用户关注的内容,按创建日期排序。Gets the feed of activity by the current user and by people and content the user is following, sorted by created date.
My/LikesMy/Likes 获取当前用户喜欢的文章的订阅源。Gets the feed of posts that the current user likes.
My/MentionFeedMy/MentionFeed 获取当前用户提及的文章的订阅源。Gets the feed of posts that mention the current user.
My/MentionFeed/ClearUnreadMentionCountMy/MentionFeed/ClearUnreadMentionCount 获取当前用户提到的文章的订阅源并清除未读的提及订阅源数量。Gets the feed of posts that mention the current user and clears the unread mention count.
My/UnreadMentionCountMy/UnreadMentionCount 获取当前用户未读的提及订阅源数量。Gets the count of unread mentions for the current user.
ActorActor 获取有关指定用户和当前用户的信息。Gets information about the specified user and the current user.
Actor/FeedActor/Feed 获取指定用户的活动订阅源。Gets the feed of activity by the specified user.
Actor/Feed/PostActor/Feed/Post 在指定网站源中创建根文章。Creates a root post in the specified site feed.
文章Post 获取包含指定文章的完整主题。Gets a full thread that contains the specified post.
Post/ReplyPost/Reply 发布对指定文章的回复。Posts a reply to the specified post.
Post/DeletePost/Delete 删除指定文章。Deletes the specified post.
Post/LikePost/Like 使当前用户成为指定文章的关注者。Makes the current user a liker of the specified post.
Post/UnlikePost/Unlike 将当前用户从指定文章的关注者列表中移除。Removes the current user from the list of likers for the specified post.
Post/LikersPost/Likers 获取喜欢指定文章的用户。Gets the users who like the specified post.
Post/LockPost/Lock 锁定指定主题。Locks the specified thread.
Post/UnlockPost/Unlock 解锁指定主题。Unlocks the specified thread.

备注

以下与源相关的 REST 资源使用其他 SharePoint REST API 使用的相同模式来构造终结点 URI。> 对于 CreateImageAttachment ,将 POST 请求发送到 http://<siteCollection>/<site>/_api/SP.Social.SocialFeedManager/CreateImageAttachment> 对于 GetPreview ,将 POST 请求发送到 http://<siteCollection>/<site>/_api/SP.Social.SocialFeedManager/GetPreview> 对于 SuppressThreadNotifications ,将 POST 请求发送到 http://<siteCollection>/<site>/_api/SP.Social.SocialFeedManager/SuppressThreadNotificationsThe following feed-related REST resources use the same pattern as the other SharePoint REST APIs to construct the endpoint URI.> For CreateImageAttachment , send a POST request to http://<siteCollection>/<site>/_api/SP.Social.SocialFeedManager/CreateImageAttachment> For GetPreview , send a POST request to http://<siteCollection>/<site>/_api/SP.Social.SocialFeedManager/GetPreview> For SuppressThreadNotifications , send a POST request to http://<siteCollection>/<site>/_api/SP.Social.SocialFeedManager/SuppressThreadNotifications

我的My

获取有关当前用户的信息。Gets information about the current user.

my 终结点将当前用户设置为 URI 中任何后续资源的上下文。例如, http://contoso.com/_api/social.feed/my/news 可获取当前用户的新闻源。The my endpoint sets the current user as the context for any subsequent resource in the URI. For example, http://contoso.com/_api/social.feed/my/news gets the newsfeed for the current user.

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/myGET http://<siteCollection>/<site>/_api/social.feed/my

请求参数Request parameter

无。None.

响应Response

类型: SP.Social.SocialRestActorType: SP.Social.SocialRestActor

关于当前用户的信息。Information about the current user.

您可以在 URI 中分别别调用 SocialRestActor 属性,例如, http://<siteCollection>/<site>/_api/social.feed/my/me 仅获取 Me 属性。You can call SocialRestActor properties individually in the URI, for example http://<siteCollection>/<site>/_api/social.feed/my/me gets only the Me property.

以下响应示例表示关于当前用户的信息。The following response example represents information about the current user.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my",
    "uri":"http://serverName/sites/dev/_api/social.feed/my",
    "type":"SP.Social.SocialRestActor"
   },
  "FollowableItem":"domain\\username1",
  "FollowableItemActor":null,
  "Me":{
    "__metadata":{"type":"SP.Social.SocialActor"},
    "AccountName":"domain\\username1",
    "ActorType":0,
    "CanFollow":false,
    "ContentUri":null,
    "EmailAddress":null,
    "FollowedContentUri":null,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
    "ImageUri":null,
    "IsFollowed":false,
    "LibraryUri":null,
    "Name":"User1 Name",
    "PersonalSiteUri":"http://serverName/my/personal/username1/",
    "Status":0,
    "StatusText":"This is post 2",
    "TagGuid":"00000000-0000-0000-0000-000000000000",
    "Title":null,
    "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
  }
}}

My/Feed/PostMy/Feed/Post

在当前用户的订阅源中创建根文章。Creates a root post in the current user's feed.

您只能在当前用户的上下文中发布内容。您无法在不同用户的订阅源中创建根文章,但您可以回复其他用户的文章。请参阅 Post/ReplyYou can post only in the context of the current user. You cannot create a root post in a different user's feed, but you can reply to another user's post. See Post/Reply.

备注

请勿将此 Post 资源与表示指定线程或帖子的 Post 资源相混淆。Don't confuse this Post resource with the Post resource that represents a specific thread or post.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/my/feed/postPOST http://<siteCollection>/<site>/_api/social.feed/my/feed/post

请求参数Request parameter

_restCreationData_

类型: SP.Social.SocialRestPostCreationDataType: SP.Social.SocialRestPostCreationData

新文章的一个 null ID 和属性,如下例所示。A null ID and the properties of the new post, as shown in the following example.

"restCreationData":{
  "__metadata":{
    "type":"SP.Social.SocialRestPostCreationData"
  },
  "ID":null,
  "creationData":{
    "__metadata":{
      "type":"SP.Social.SocialPostCreationData"
    },
    "ContentText":"This post was published using REST.",
    "UpdateStatusText":false
  }
}

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

包含新的根文章的主题。A thread that contains the new root post.

以下响应示例展示了包含新的根文章的主题。The following response example represents the thread that contains the new root post.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username1",
        "ActorType":0,
        "CanFollow":false,
        "ContentUri":null,
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":false,
        "LibraryUri":null,
        "Name":"User1 Name",
        "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
        "Status":0,
        "StatusText":"",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
      }]
    },
    "Attributes":6,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "OwnerIndex":0,
    "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "PostReference":null,
    "Replies":{"results":[]},
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:31:57.204511Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-17T19:31:57.204511Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":0
  }
}}

My/FeedMy/Feed

获取当前用户的活动订阅源( Personal 源类型)。Gets the feed of activity by the current user ( Personal feed type).

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/my/feedGET http://<siteCollection>/<site>/_api/social.feed/my/feed

GET http://<siteCollection>/<site>/_api/social.feed/my/feed(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'GET http://<siteCollection>/<site>/_api/social.feed/my/feed(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'

请求参数Request parameter

_feedOptions_(可选)_feedOptions_ (optional)

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

主题的最大数量、日期-时间范围和排序顺序。您可以选择性地指定这些属性的任意组合,例如,您可以仅指定 MaxThreadCount 属性。The maximum number of threads, date-time range, and sort order. You can optionally specify any combination of these properties, for example, you can specify only the MaxThreadCount property.

可使用 @ 别名传递特殊字符。You can use an @ alias to pass special characters. 例如,<siteUri>/_api/social.feed/my/feed(OlderThan=@v)?@v=datetime'2013-01-01T08:00' 使用 @v 别名发送一个 : 字符。For example, <siteUri>/_api/social.feed/my/feed(OlderThan=@v)?@v=datetime'2013-01-01T08:00' uses the @v alias to send a : character.

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

当前用户的个人订阅源。The current user's personal feed.

以下响应示例表示当前用户的个人订阅源。The following response example represents the current user's personal feed.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my/feed",
    "uri":"http://serverName/sites/dev/_api/social.feed/my/feed",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"},
    "Attributes":1,
    "NewestProcessed":"2013-04-15T06:10:11Z",
    "OldestProcessed":"2013-04-15T05:33:12Z",
    "Threads":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":null,
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          },{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName/my/personal/username2",
            "Status":6,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
          }]
        },
        "Attributes":6,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "PostReference":null,
        "Replies":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialPost"},
            "Attachment":null,
            "Attributes":23,
            "AuthorIndex":1,
            "CreatedTime":"2013-04-15T06:10:11.3480926Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.59c0273c6c7b41e784b496c9aaa909a8.17.24.S-1-5-21-2127521184-1604012920-1887927527-66602",
            "LikerInfo":{
              "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
              "IncludesCurrentUser":false,
              "Indexes":{"results":[]},
              "TotalCount":0
            },
            "ModifiedTime":"2013-04-15T06:10:11.3480926Z",
            "Overlays":{"results":[]},
            "PostType":1,
            "PreferredImageUri":null,
            "Source":{
              "__metadata":{"type":"SP.Social.SocialLink"},
              "Text":null,
              "Uri":null
            },
            "Text":"This is a reply to post 1."
          }]
        },
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-15T05:58:24Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0
          },
          "ModifiedTime":"2013-04-15T06:10:11Z",
          "Overlays":{"results":[]},
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"This is post 1."
        },
        "Status":0,
        "ThreadType":0,
        "TotalReplyCount":1
      },{
      "__metadata":{"type":"SP.Social.SocialThread"},
      "Actors":{
        "results":[{
          "__metadata":{"type":"SP.Social.SocialActor"},
          "AccountName":"domain\\username1",
          "ActorType":0,
          "CanFollow":false,
          "ContentUri":null,
          "EmailAddress":null,
          "FollowedContentUri":null,
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
          "ImageUri":null,
          "IsFollowed":false,
          "LibraryUri":null,
          "Name":"User1 Name",
          "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
          "Status":0,
          "StatusText":"",
          "TagGuid":"00000000-0000-0000-0000-000000000000",
          "Title":null,
          "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
        }]
      },
      "Attributes":6,
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "OwnerIndex":0,
      "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "PostReference":null,
      "Replies":{"results":[]},
      "RootPost":{
        "__metadata":{"type":"SP.Social.SocialPost"},
        "Attachment":null,
        "Attributes":23,
        "AuthorIndex":0,
        "CreatedTime":"2013-04-15T06:07:05Z",
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "LikerInfo":{
          "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
          "IncludesCurrentUser":false,
          "Indexes":{"results":[]},
          "TotalCount":0},
          "ModifiedTime":"2013-04-15T06:07:05Z",
          "Overlays":{"results":[]},
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,"Uri":null},
            "Text":"This is post 2."
          },
          "Status":0,
          "ThreadType":0,
          "TotalReplyCount":0
        },{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":null,
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          },{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName/my/personal/username2",
            "Status":6,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
          }]
      },
      "Attributes":0,
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.cecc0de3d7d04520bb87a181b24c105a.16.16.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "OwnerIndex":0,
      "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
      "PostReference":{
        "__metadata":{"type":"SP.Social.SocialPostReference"},
        "Digest":null,
        "Post":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":1,
          "CreatedTime":"2013-04-15T05:05:13Z",
          "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":true,
            "Indexes":{"results":[]},
            "TotalCount":1
          },
          "ModifiedTime":"2013-04-15T05:05:13Z",
          "Overlays":{
            "results":[{
              "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[0]},
              "Index":1,
              "Length":18,
              "LinkUri":null,
              "OverlayType":1
            }]
          },
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"@User1 Name presented at the conference."},
          "ThreadId":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
          "ThreadOwnerIndex":1
        },
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":14,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-15T05:33:12Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.cecc0de3d7d04520bb87a181b24c105a.16.16.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":null,
          "ModifiedTime":"2013-04-15T05:33:12Z",
          "Overlays":{
            "results":[{
              "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[0]},
              "Index":0,
              "Length":18,
              "LinkUri":null,
              "OverlayType":1
            },{
            "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[1]},
              "Index":35,
              "Length":10,
              "LinkUri":null,
              "OverlayType":1
            }]
          },
          "PostType":0,
          "PreferredImageUri":"http://serverName:80/_layouts/15/Images/Like.11x11x32.png",
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,"Uri":null
          },
          "Text":"User1 Name liked a post by User2 Name."
        },
        "Status":0,
        "ThreadType":1,
        "TotalReplyCount":0
      }]
    },
    "UnreadMentionCount":1
  }
}}

My/NewsMy/News

获取当前用户和好友的活动订阅源及用户关注的内容,按最后修改日期排序( News 订阅源类型)。Gets the feed of activity by the current user and by people and content the user is following, sorted by last modified date ( News feed type).

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/my/newsGET http://<siteCollection>/<site>/_api/social.feed/my/news

GET http://<siteCollection>/<site>/_api/social.feed/my/news(MaxThreadCount=10,NewerThan=@v)?@v=datetime'2013-01-01T08:00'GET http://<siteCollection>/<site>/_api/social.feed/my/news(MaxThreadCount=10,NewerThan=@v)?@v=datetime'2013-01-01T08:00'

请求参数Request parameter

_feedOptions_(可选)_feedOptions_ (optional)

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

主题的最大数量、日期-时间范围和排序顺序。你可以选择性地指定这些属性的任意组合,例如,你可以仅指定 MaxThreadCount 属性。The maximum number of threads, date-time range, and sort order. You can optionally specify any combination of these properties, for example, you can specify only the MaxThreadCount property.

你可以使用一个 @ 别名传递特殊字符。例如, <siteUri>/_api/social.feed/my/News(OlderThan=@v)?@v=datetime'2013-01-01T08:00' 使用 @v 别名发送一个 : 字符。You can use an @ alias to pass special characters. For example, <siteUri>/_api/social.feed/my/News(OlderThan=@v)?@v=datetime'2013-01-01T08:00' uses the @v alias to send a : character.

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

当前用户的新闻源。The current user's newsfeed.

以下响应示例表示当前用户的新闻源。The following response example represents the current user's newsfeed.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my/news",
    "uri":"http://serverName/sites/dev/_api/social.feed/my/news",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"},
    "Attributes":1,
    "NewestProcessed":"2013-04-15T06:10:11.4730902Z",
    "OldestProcessed":"2013-04-12T20:51:51Z",
    "Threads":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":"http://serverName:80/my/_layouts/15/MySite.aspx?MySiteRedirect=FollowedDocuments",
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          },{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName/my/personal/username2",
            "Status":0,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
          }]
        },
        "Attributes":6,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "PostReference":null,
        "Replies":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialPost"},
            "Attachment":null,
            "Attributes":23,
            "AuthorIndex":1,
            "CreatedTime":"2013-04-15T06:10:11.3480926Z",
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.59c0273c6c7b41e784b496c9aaa909a8.17.24.S-1-5-21-2127521184-1604012920-1887927527-66602",
            "LikerInfo":{
              "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
              "IncludesCurrentUser":false,
              "Indexes":{"results":[]},
              "TotalCount":0
            },
            "ModifiedTime":"2013-04-15T06:10:11.3480926Z",
            "Overlays":{"results":[]},
            "PostType":1,
            "PreferredImageUri":null,
            "Source":{
              "__metadata":{"type":"SP.Social.SocialLink"},
              "Text":null,
              "Uri":null
            },
            "Text":"This is a reply to post 1."
          }]
        },
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-15T05:58:24Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0},
            "ModifiedTime":"2013-04-15T06:10:11.4730902Z",
            "Overlays":{"results":[]},
            "PostType":0,
            "PreferredImageUri":null,
            "Source":{
              "__metadata":{"type":"SP.Social.SocialLink"},
              "Text":null,
              "Uri":null
            },
            "Text":"This is post 1."
          },
          "Status":0,
          "ThreadType":0,
          "TotalReplyCount":1
        },{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":"http://serverName:80/my/_layouts/15/MySite.aspx?MySiteRedirect=FollowedDocuments",
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          }]
        },
        "Attributes":6,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "PostReference":null,
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-15T06:07:05.4804434Z","Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0
          },
          "ModifiedTime":"2013-04-15T06:07:05.4804434Z",
          "Overlays":{"results":[]},
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"This is post 2."
        },
        "Status":0,
        "ThreadType":0,
        "TotalReplyCount":0
      }]
    },
    "UnreadMentionCount":1
  }
}}

My/TimelineFeedMy/TimelineFeed

获取当前用户和好友的活动订阅源及用户关注的内容,按创建日期排序( Timeline 订阅源类型)。Gets the feed of activity by the current user and by people and content the user is following, sorted by created date ( Timeline feed type).

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/my/timelinefeedGET http://<siteCollection>/<site>/_api/social.feed/my/timelinefeed

GET http://<siteCollection>/<site>/_api/social.feed/my/timelinefeed(MaxThreadCount=10,NewerThan=@v)?@v=datetime'2013-01-01T08:00'GET http://<siteCollection>/<site>/_api/social.feed/my/timelinefeed(MaxThreadCount=10,NewerThan=@v)?@v=datetime'2013-01-01T08:00'

请求参数Request parameter

_feedOptions_(可选)_feedOptions_ (optional)

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

主题的最大数量、日期-时间范围和排序顺序。你可以选择性地指定这些属性的任意组合,例如,你可以仅指定 MaxThreadCount 属性。The maximum number of threads, date-time range, and sort order. You can optionally specify any combination of these properties, for example, you can specify only the MaxThreadCount property.

你可以使用一个 @ 别名传递特殊字符。例如, <siteUri>/_api/social.feed/my/timelinefeed(OlderThan=@v)?@v=datetime'2013-01-01T08:00' 使用 @v 别名发送一个 : 字符。You can use an @ alias to pass special characters. For example, <siteUri>/_api/social.feed/my/timelinefeed(OlderThan=@v)?@v=datetime'2013-01-01T08:00' uses the @v alias to send a : character.

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

当前用户的时间线订阅源。The current user's timeline feed.

以下响应示例表示当前用户的时间线订阅源,按创建日期排序。The following response example represents the current user's timeline feed, which is sorted by created date.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my/timelinefeed",
    "uri":"http://serverName/sites/dev/_api/social.feed/my/timelinefeed",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"},
    "Attributes":1,
    "NewestProcessed":"2013-04-15T06:07:05.4804434Z",
    "OldestProcessed":"2013-04-12T20:51:51Z",
    "Threads":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":"http://serverName:80/my/_layouts/15/MySite.aspx?MySiteRedirect=FollowedDocuments",
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"This is post 2.",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          }]
        },
        "Attributes":6,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "PostReference":null,
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-15T06:07:05.4804434Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.82e71ca2381b4657935546e57f1992d5.23.23.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0
          },
          "ModifiedTime":"2013-04-15T06:07:05.4804434Z",
          "Overlays":{"results":[]},
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"This is post 2."
        },
        "Status":0,
        "ThreadType":0,
        "TotalReplyCount":0
      },{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":"http://serverName:80/my/_layouts/15/MySite.aspx?MySiteRedirect=FollowedDocuments",
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"This is post 2.",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          }]
        },
        "Attributes":6,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "PostReference":null,
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-15T05:58:24Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0
          },
          "ModifiedTime":"2013-04-15T06:04:49Z",
          "Overlays":{"results":[]},
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"This is post 1."
        },
        "Status":0,
        "ThreadType":0,
        "TotalReplyCount":0
      }]
    },
    "UnreadMentionCount":1
  }
}}

My/LikesMy/Likes

获取当前用户赞的微博帖子的源(由 LikeReference 线程类型表示)。Gets the feed of microblog posts that the current user likes, represented by LikeReference thread types. 请参阅 SharePoint 社交源中的引用线程和摘要线程See Reference threads and digest threads in SharePoint social feeds.

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/my/likesGET http://<siteCollection>/<site>/_api/social.feed/my/likes

GET http://<siteCollection>/<site>/_api/social.feed/my/likes(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'GET http://<siteCollection>/<site>/_api/social.feed/my/likes(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'

请求参数Request parameter

_feedOptions_(可选)_feedOptions_ (optional)

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

主题的最大数量、日期-时间范围和排序顺序。你可以选择性地指定这些属性的任意组合,例如,你可以仅指定 MaxThreadCount 属性。The maximum number of threads, date-time range, and sort order. You can optionally specify any combination of these properties, for example, you can specify only the MaxThreadCount property.

你可以选择在查询字符串中指定检索选项。你可以使用 @ 别名传递特殊字符。例如, <siteUri>/_api/social.feed/my/likes(OlderThan=@v)?@v=datetime'2013-01-01T08:00' 使用 @v 别名发送 : 字符。You can optionally specify retrieval options in the query string. You can use an @ alias to pass special characters. For example, <siteUri>/_api/social.feed/my/likes(OlderThan=@v)?@v=datetime'2013-01-01T08:00' uses the @v alias to send a : character.

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

包含当前用户喜欢的文章的订阅源。A feed that contains posts that the current user likes.

以下响应示例表示对当前用户喜欢的文章的引用。主题为 LikeReference 主题类型(值 = 1 ),其 PostReference 属性会引用实际文章。The following response example represents a reference to a post that the current user likes. The thread is a LikeReference thread type (value = 1 ) whose PostReference property references the actual post.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my/likes",
    "uri":"http://serverName/sites/dev/_api/social.feed/my/likes",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"}.
    "Attributes":1,
    "NewestProcessed":"2013-04-15T05:33:12Z",
    "OldestProcessed":"2013-04-15T05:33:12Z",
    "Threads":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":null,
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"This is post 2",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          },{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName/my/personal/username2",
            "Status":6,
            "StatusText":"@User1 Name presented at the conference.",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"}]
          },
          "Attributes":0,
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.cecc0de3d7d04520bb87a181b24c105a.16.16.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "OwnerIndex":0,
          "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
          "PostReference":{
            "__metadata":{"type":"SP.Social.SocialPostReference"},
            "Digest":null,
            "Post":{
              "__metadata":{"type":"SP.Social.SocialPost"},
              "Attachment":null,
              "Attributes":23,
              "AuthorIndex":1,
              "CreatedTime":"2013-04-15T05:05:13Z",
              "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
              "LikerInfo":{
                "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
                "IncludesCurrentUser":true,
                "Indexes":{"results":[]},
                "TotalCount":1
              },
              "ModifiedTime":"2013-04-15T05:05:13Z",
              "Overlays":{
                "results":[{
                  "__metadata":{"type":"SP.Social.SocialDataOverlay"},
                  "ActorIndexes":{"results":[0]},
                  "Index":1,
                  "Length":18,
                  "LinkUri":null,
                  "OverlayType":1
                }]
              },
              "PostType":0,
              "PreferredImageUri":null,
              "Source":{
                "__metadata":{"type":"SP.Social.SocialLink"},
                "Text":null,
                "Uri":null
              },
              "Text":"@User1 Name presented at the conference."
            },
            "ThreadId":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
            "ThreadOwnerIndex":1
          },
          "Replies":{"results":[]},
          "RootPost":{
            "__metadata":{"type":"SP.Social.SocialPost"},
            "Attachment":null,
            "Attributes":14,
            "AuthorIndex":0,
            "CreatedTime":"2013-04-15T05:33:12Z",
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.cecc0de3d7d04520bb87a181b24c105a.16.16.S-1-5-21-2127521184-1604012920-1887927527-66602",
            "LikerInfo":null,
            "ModifiedTime":"2013-04-15T05:33:12Z",
            "Overlays":{
              "results":[{
                "__metadata":{"type":"SP.Social.SocialDataOverlay"},
                "ActorIndexes":{"results":[0]},
                "Index":0,
                "Length":18,
                "LinkUri":null,
                "OverlayType":1
              },{
                "__metadata":{"type":"SP.Social.SocialDataOverlay"},
                "ActorIndexes":{"results":[1]},
                "Index":35,
                "Length":10,
                "LinkUri":null,
                "OverlayType":1
              }]
            },
            "PostType":0,
            "PreferredImageUri":"http://serverName:80/_layouts/15/Images/Like.11x11x32.png",
            "Source":{
              "__metadata":{"type":"SP.Social.SocialLink"},
              "Text":null,
              "Uri":null
            },
            "Text":"User1 Name liked a post by User2 Name."
          },
          "Status":0,
          "ThreadType":1,
          "TotalReplyCount":0
        }]
      },
    "UnreadMentionCount":1
  }
}}

My/MentionFeedMy/MentionFeed

获取提及当前用户的微博帖子的源(由 MentionReference 线程类型表示)。Gets the feed of microblog posts that mention the current user, represented by MentionReference thread types. 请参阅 SharePoint 社交源中的引用线程和摘要线程See Reference threads and digest threads in SharePoint social feeds.

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/my/mentionfeedGET http://<siteCollection>/<site>/_api/social.feed/my/mentionfeed

GET http://<siteCollection>/<site>/_api/social.feed/my/mentionfeed(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'GET http://<siteCollection>/<site>/_api/social.feed/my/mentionfeed(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'

请求参数Request parameter

_feedOptions_(可选)_feedOptions_ (optional)

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

主题的最大数量、日期-时间范围和排序顺序。你可以选择性地指定这些属性的任意组合,例如,你可以仅指定 MaxThreadCount 属性。The maximum number of threads, date-time range, and sort order. You can optionally specify any combination of these properties, for example, you can specify only the MaxThreadCount property.

你可以使用 @ 别名传递特殊字符。例如, <siteUri>/_api/social.feed/my/likes(OlderThan=@v)?@v=datetime'2013-01-01T08:00' 使用 @v 别名发送 : 字符。You can use an @ alias to pass special characters. For example, <siteUri>/_api/social.feed/my/likes(OlderThan=@v)?@v=datetime'2013-01-01T08:00' uses the @v alias to send a : character.

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

包含提及当前用户的文章的订阅源。A feed that contains posts that mention the current user.

以下响应示例表示提及当前用户的主题。主题为 MentionReference 主题类型(值 = 3 ),其 PostReference 属性会引用实际文章。The following response example represents one thread that mentions the current user. The thread is a MentionReference thread type (value = 3 ) whose PostReference property references the actual post.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my/mentionfeed",
    "uri":"http://serverName/sites/dev/_api/social.feed/my/mentionfeed",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"},
    "Attributes":1,
    "NewestProcessed":"2013-04-15T05:05:19Z",
    "OldestProcessed":"2013-04-15T05:05:19Z",
    "Threads":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":null,
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
            "Status":0,
            "StatusText":"This is post 2",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          },{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName/my/personal/username2",
            "Status":6,
            "StatusText":"@User1 Name presented at the conference.",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
          }]
        },
        "Attributes":0,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ec5198399300401fb44f0f5c9d8dea80.15.15.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
        "PostReference":{
          "__metadata":{"type":"SP.Social.SocialPostReference"},
          "Digest":null,
          "Post":{
            "__metadata":{"type":"SP.Social.SocialPost"},
            "Attachment":null,
            "Attributes":23,
            "AuthorIndex":1,
            "CreatedTime":"2013-04-15T05:05:12.0102795Z",
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
            "LikerInfo":{
              "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
              "IncludesCurrentUser":false,
              "Indexes":{"results":[]},
              "TotalCount":0
            },
            "ModifiedTime":"2013-04-15T05:05:12.0102795Z",
            "Overlays":{
              "results":[{
                "__metadata":{"type":"SP.Social.SocialDataOverlay"},
                "ActorIndexes":{"results":[0]},
                "Index":1,
                "Length":18,
                "LinkUri":null,
                "OverlayType":1
              }]
            },
            "PostType":0,
            "PreferredImageUri":null,
            "Source":{
              "__metadata":{"type":"SP.Social.SocialLink"},
              "Text":null,
              "Uri":null
            },
            "Text":"@User1 Name presented at the conference."
          },
          "ThreadId":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
          "ThreadOwnerIndex":1
        },
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":14,
          "AuthorIndex":1,
          "CreatedTime":"2013-04-15T05:05:19Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ec5198399300401fb44f0f5c9d8dea80.15.15.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":null,
          "ModifiedTime":"2013-04-15T05:05:19Z",
          "Overlays":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialDataOverlay"},
            "ActorIndexes":{"results":[1]},
            "Index":13,
            "Length":10,
            "LinkUri":null,
            "OverlayType":1
          }]
        },
        "PostType":0,
        "PreferredImageUri":"http://serverName:80/_layouts/15/Images/mention.11x11x32.png",
        "Source":{
          "__metadata":{"type":"SP.Social.SocialLink"},
          "Text":null,
          "Uri":null
        },
        "Text":"Mentioned by User2 Name."},
        "Status":0,
        "ThreadType":3,
        "TotalReplyCount":0
      }]
    },
    "UnreadMentionCount":1
  }
}}

My/MentionFeed/ClearUnreadMentionCountMy/MentionFeed/ClearUnreadMentionCount

获取提及当前用户的微博帖子的源(由 MentionReference 线程类型表示),并将用户未读的提及内容源计数设置为 0。Gets the feed of microblog posts that mention the current user, represented by MentionReference thread types, and sets the user's unread mention count to 0. 请参阅 SharePoint 社交源中的引用线程和摘要线程See Reference threads and digest threads in SharePoint social feeds.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/my/mentionfeed/clearunreadmentioncountPOST http://<siteCollection>/<site>/_api/social.feed/my/mentionfeed/clearunreadmentioncount

请求参数Request parameter

_feedOptions_

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

此参数必须作为请求正文的 data 属性中的空字符串发送,如以下示例中所示。This parameter must be sent as an empty string in the data attribute of the request body, as shown in the following example.

"feedOptions": {
  "__metadata": {
    "type": "SP.Social.SocialFeedOptions"
  },
}

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

当前用户提及的订阅源。The current user's mention feed.

以下响应示例表示当前用户提及的订阅源。主题为 MentionReference 主题类型(值 = 3 ),其 PostReference 属性会引用实际文章。检索订阅源之后,未读的提及订阅源数量将清除。The following response example represents the current user's mention feed. The thread is a MentionReference thread type (value = 3 ) whose PostReference property references the actual post. The unread mention count is cleared after the feed is retrieved.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/my/mentionfeed",
    "uri":"http://serverName/sites/dev/_api/social.feed/my/mentionfeed",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"},
    "Attributes":1,
    "NewestProcessed":"2013-04-15T05:05:19Z",
    "OldestProcessed":"2013-04-15T05:05:19Z",
    "Threads":{
      "results":[{
      "__metadata":{"type":"SP.Social.SocialThread"},
      "Actors":{
        "results":[{
          "__metadata":{"type":"SP.Social.SocialActor"},
          "AccountName":"domain\\username1",
          "ActorType":0,
          "CanFollow":false,
          "ContentUri":null,
          "EmailAddress":null,
          "FollowedContentUri":null,
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
          "ImageUri":null,
          "IsFollowed":false,
          "LibraryUri":null,
          "Name":"User1 Name",
          "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
          "Status":0,
          "StatusText":"Posted with REST.",
          "TagGuid":"00000000-0000-0000-0000-000000000000",
          "Title":null,
          "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
        },{
          "__metadata":{"type":"SP.Social.SocialActor"},
          "AccountName":"domain\\username2",
          "ActorType":0,
          "CanFollow":true,
          "ContentUri":null,
          "EmailAddress":"username2@somecompany.com",
          "FollowedContentUri":null,
          "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
          "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
          "IsFollowed":true,
          "LibraryUri":null,
          "Name":"User2 Name",
          "PersonalSiteUri":"http://serverName/my/personal/username2",
          "Status":6,
          "StatusText":"This is post 1 from the specified user.",
          "TagGuid":"00000000-0000-0000-0000-000000000000",
          "Title":"SOME TITLE",
          "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
        }]
      },
      "Attributes":0,
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ec5198399300401fb44f0f5c9d8dea80.15.15.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "OwnerIndex":0,
      "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
      "PostReference":{
        "__metadata":{"type":"SP.Social.SocialPostReference"},
        "Digest":null,
        "Post":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":1,
          "CreatedTime":"2013-04-15T05:05:12.0102795Z",
          "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0
          },
          "ModifiedTime":"2013-04-15T05:05:12.0102795Z",
          "Overlays":{
            "results":[{
              "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[0]},
              "Index":1,
              "Length":18,
              "LinkUri":null,
              "OverlayType":1
            }]
          },
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"@User1 Name presented at the conference."},
          "ThreadId":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.ca83f758aab04065bc303398f2701eb9.10.10.S-1-5-21-124525095-708259637-1543119021-628175",
          "ThreadOwnerIndex":1
        },
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":14,
          "AuthorIndex":1,
          "CreatedTime":"2013-04-15T05:05:19Z",
          "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ec5198399300401fb44f0f5c9d8dea80.15.15.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "LikerInfo":null,
          "ModifiedTime":"2013-04-15T05:05:19Z",
          "Overlays":{
            "results":[{
              "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[1]},
              "Index":13,
              "Length":10,
              "LinkUri":null,
              "OverlayType":1
            }]
          },
          "PostType":0,
          "PreferredImageUri":"http://serverName:80/_layouts/15/Images/mention.11x11x32.png",
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"Mentioned by User2 Name."
        },
        "Status":0,
        "ThreadType":3,
        "TotalReplyCount":0
      }]
    },
    "UnreadMentionCount":1
  }
}}

My/UnreadMentionCountMy/UnreadMentionCount

获取当前用户未读的提及订阅源数量。Gets the count of unread mentions for the current user.

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/my/unreadmentioncountGET http://<siteCollection>/<site>/_api/social.feed/my/unreadmentioncount

请求参数Request parameter

无。None.

响应Response

类型: Int32Type: Int32

当前用户提及的未读订阅源数量。The count of unread mentions for the current user.

以下响应示例表示未读的提及订阅源数量为 1。The following response example represents an unread mention count of 1.

{"d":{"UnreadMentionCount":1}}

ActorActor

获取有关指定用户和当前用户的信息。Gets information about the specified user and the current user.

备注

actor 终结点将指定用户或网站源设置为 URI 中任何后续资源的上下文。The actor endpoint sets the specified user or site feed as the context for any subsequent resource in the URI. 例如,http://contoso.com/_api/social.feed/actor(item='domain\\user')/feed 获取指定用户的个人源,http://contoso.com/_api/social.feed/actor(item=@v)/feed?@v='http://<server>/<teamSite>/newsfeed.aspx' 获取指定团队网站的网站源。For example, http://contoso.com/_api/social.feed/actor(item='domain\\user')/feed gets the personal feed for the specified user and http://contoso.com/_api/social.feed/actor(item=@v)/feed?@v='http://<server>/<teamSite>/newsfeed.aspx' gets the site feed for the specified team site.

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')GET http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')

GET http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)?@v='i:0"%23".f|membership|user@domain.com'GET http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)?@v='i:0"%23".f|membership|user@domain.com'

请求参数Request parameter

_item_

类型: StringType: String

指定用户的帐户名称。The account name of the specified user.

你可在查询字符串中发送 item 参数。你可以使用 @ 别名传递特殊字符,例如 <siteUri>/_api/social.feed/actor(item=@v)?@v='i:0"%23".f|membership|user@domain.com' 使用 @v 别名和 "%23" 编码发送 # 字符。You send the item parameter in the query string. You can use an @ alias to pass special characters. For example, <siteUri>/_api/social.feed/actor(item=@v)?@v='i:0"%23".f|membership|user@domain.com' uses the @v alias and the "%23" encoding to send a # character.

响应Response

类型: SP.Social.SocialRestActorType: SP.Social.SocialRestActor

关于指定用户和当前用户的信息。Information about the specified user and the current user.

您可以在 URI 中分别调用 SocialRestActor 属性,例如, http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')/followableitem 仅获取指定用户的 FollowableItem 属性。You can call SocialRestActor properties individually in the URI, for example http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')/followableitem gets only the FollowableItem property for the specified actor.

以下响应示例表示关于指定用户和当前用户的信息。The following response example represents information about the specified user and the current user.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/actor(Item=@ai)/?@ai='domain\\username2'",
    "uri":"http://serverName/sites/dev/_api/social.feed/actor(Item=@ai)/?@ai='domain%5cusername2'",
    "type":"SP.Social.SocialRestActor"
  },
  "FollowableItem":"domain\\username2",
  "FollowableItemActor":{
    "__metadata":{"type":"SP.Social.SocialActor"},
    "AccountName":"domain\\username2",
    "ActorType":0,
    "CanFollow":true,
    "ContentUri":null,
    "EmailAddress":"username2@somecompany.com",
    "FollowedContentUri":null,
    "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
    "ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
    "IsFollowed":true,
    "LibraryUri":null,
    "Name":"User2 Name",
    "PersonalSiteUri":"http://serverName/my/personal/username2",
    "Status":0,
    "StatusText":"",
    "TagGuid":"00000000-0000-0000-0000-000000000000",
    "Title":"SOME TITLE",
    "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
  },
  "Me":{
    "__metadata":{"type":"SP.Social.SocialActor"},
    "AccountName":"domain\\username1",
    "ActorType":0,
    "CanFollow":false,
    "ContentUri":null,
    "EmailAddress":null,
    "FollowedContentUri":null,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
    "ImageUri":null,
    "IsFollowed":false,
    "LibraryUri":null,
    "Name":"User1 Name",
    "PersonalSiteUri":"http://serverName/my/personal/username1/",
    "Status":0,
    "StatusText":"This is post 2",
    "TagGuid":"00000000-0000-0000-0000-000000000000",
    "Title":null,
    "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
  }
}}

Actor/FeedActor/Feed

获取指定用户的活动订阅源( Personal 订阅源类型)或者获取指定网站源。Gets the feed of activity by the specified user ( Personal feed type) or gets the specified site feed.

终结点 URI 结构Endpoint URI structure

GET http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')/feedGET http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')/feed

GET http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)/feed?@v='i:0"%23".f|membership|user@domain.com'GET http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)/feed?@v='i:0"%23".f|membership|user@domain.com'

GET http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')/feed(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'GET http://<siteCollection>/<site>/_api/social.feed/actor(item='domain\\user')/feed(MaxThreadCount=10,SortOrder=1,NewerThan=@v)?@v=datetime'2013-01-01T08:00'

GET http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)/feed?@v='http://<teamSiteUri>/newsfeed.aspx'GET http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)/feed?@v='http://<teamSiteUri>/newsfeed.aspx'

请求参数Request parameter

_feedOptions_(可选)_feedOptions_ (optional)

类型: SP.Social.SocialFeedOptionsType: SP.Social.SocialFeedOptions

主题的最大数量、日期-时间范围和排序顺序。你可以选择性地指定这些属性的任意组合,例如,你可以仅指定 MaxThreadCount 属性。The maximum number of threads, date-time range, and sort order. You can optionally specify any combination of these properties, for example, you can specify only the MaxThreadCount property.

你可以使用 @ 别名传递特殊字符。例如, <siteUri>/_api/social.feed/actor(item=@v)/feed(NewerThan=@x)?@v='i:0"%23".f|membership|user@domain.com'&amp;@x=datetime'2013-01-01T08:00' 使用 @v 别名和 "%23" 编码发送 # 字符,使用 @x 别名发送 : 字符。You can use an @ alias to pass special characters. For example, <siteUri>/_api/social.feed/actor(item=@v)/feed(NewerThan=@x)?@v='i:0"%23".f|membership|user@domain.com'&amp;@x=datetime'2013-01-01T08:00' uses the @v alias and the "%23" encoding to send a # character, and the @x alias to send a : character.

响应Response

类型: SP.Social.SocialRestFeedType: SP.Social.SocialRestFeed

指定用户的个人订阅源或指定 URI 的网站源。The personal feed of the specified user or the site feed at the specified URI.

以下响应示例表示指定用户的个人订阅源。The following response example represents personal feed of the specified user.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/actor(Item=@ai)/feed/?@ai='domain\\username2'",
    "uri":"http://serverName/sites/dev/_api/social.feed/actor(Item=@ai)/feed/?@ai='domain%5cusername2'",
    "type":"SP.Social.SocialRestFeed"
  },
  "SocialFeed":{
    "__metadata":{"type":"SP.Social.SocialFeed"},
    "Attributes":1,
    "NewestProcessed":"2013-04-16T22:40:55Z",
    "OldestProcessed":"2013-04-16T22:40:07Z",
    "Threads":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User%20Photos/Profile%20Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username2",
            "Status":0,
            "StatusText":"This is post 1 from the specified user.",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
          },{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username1",
            "ActorType":0,
            "CanFollow":false,
            "ContentUri":null,
            "EmailAddress":null,
            "FollowedContentUri":null,
            "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":null,
            "IsFollowed":false,
            "LibraryUri":null,
            "Name":"User1 Name",
            "PersonalSiteUri":"http://serverName/my/personal/username1/",
            "Status":0,
            "StatusText":"",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":null,
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
          }]
        },
        "Attributes":0,
        "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.4cb7a5d36cb14d62b0fb68ef98f9765e.15.15.S-1-5-21-124525095-708259637-1543119021-628175",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "PostReference":{
          "__metadata":{"type":"SP.Social.SocialPostReference"},
          "Digest":null,
          "Post":null,
          "ThreadId":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.c554cbf1934b4c82bb1d43ebf961de92.17.17.S-1-5-21-2127521184-1604012920-1887927527-66602",
          "ThreadOwnerIndex":1
        },
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":14,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-16T22:40:55Z",
          "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.4cb7a5d36cb14d62b0fb68ef98f9765e.15.15.S-1-5-21-124525095-708259637-1543119021-628175",
          "LikerInfo":null,
          "ModifiedTime":"2013-04-16T22:40:55Z",
          "Overlays":{
            "results":[{
              "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[0]},
              "Index":0,
              "Length":10,
              "LinkUri":null,
              "OverlayType":1
            },{
              "__metadata":{"type":"SP.Social.SocialDataOverlay"},
              "ActorIndexes":{"results":[1]},
              "Index":32,
              "Length":18,
              "LinkUri":null,
              "OverlayType":1
            }]
          },
          "PostType":0,
          "PreferredImageUri":"http://serverName:80/_layouts/15/Images/RepliedTo.11x11x32.png",
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"User2 Name replied to a post by User1 Name."
        },
        "Status":0,
        "ThreadType":2,
        "TotalReplyCount":0
      },{
        "__metadata":{"type":"SP.Social.SocialThread"},
        "Actors":{
          "results":[{
            "__metadata":{"type":"SP.Social.SocialActor"},
            "AccountName":"domain\\username2",
            "ActorType":0,
            "CanFollow":true,
            "ContentUri":null,
            "EmailAddress":"username2@somecompany.com",
            "FollowedContentUri":null,
            "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b",
            "ImageUri":"http://serverName:80/my/User%20Photos/Profile%20Pictures/username2_MThumb.jpg",
            "IsFollowed":true,
            "LibraryUri":null,
            "Name":"User2 Name",
            "PersonalSiteUri":"http://serverName:80/my/personal/username2",
            "Status":0,
            "StatusText":"This is post 1 from the specified user.",
            "TagGuid":"00000000-0000-0000-0000-000000000000",
            "Title":"SOME TITLE",
            "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
          }]
        },
        "Attributes":6,
        "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.b83675d28e264e69823205ad4e76df9f.14.14.S-1-5-21-124525095-708259637-1543119021-628175",
        "OwnerIndex":0,
        "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.b83675d28e264e69823205ad4e76df9f.14.14.S-1-5-21-124525095-708259637-1543119021-628175",
        "PostReference":null,
        "Replies":{"results":[]},
        "RootPost":{
          "__metadata":{"type":"SP.Social.SocialPost"},
          "Attachment":null,
          "Attributes":23,
          "AuthorIndex":0,
          "CreatedTime":"2013-04-16T22:40:07Z",
          "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b.b83675d28e264e69823205ad4e76df9f.14.14.S-1-5-21-124525095-708259637-1543119021-628175",
          "LikerInfo":{
            "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
            "IncludesCurrentUser":false,
            "Indexes":{"results":[]},
            "TotalCount":0
          },
          "ModifiedTime":"2013-04-16T22:40:07Z",
          "Overlays":{"results":[]},
          "PostType":0,
          "PreferredImageUri":null,
          "Source":{
            "__metadata":{"type":"SP.Social.SocialLink"},
            "Text":null,
            "Uri":null
          },
          "Text":"This is post 1 from the specified user."
        },
        "Status":0,
        "ThreadType":0,
        "TotalReplyCount":0
      }]
    },
    "UnreadMentionCount":0
  }
}}

Actor/Feed/PostActor/Feed/Post

在指定网站源中创建根文章。Creates a root post in the specified site feed.

您只能在当前用户的上下文中发布内容。您无法在不同用户的订阅源中创建根文章,但您可以回复其他用户的文章。请参阅 Post/ReplyYou can post only in the context of the current user. You cannot create a root post in a different user's feed, but you can reply to another user's post. See Post/Reply.

备注

请勿将此 Post 资源与表示指定线程或帖子的 Post 资源相混淆。Don't confuse this Post resource with the Post resource that represents a specific thread or post.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)/feed/post?@v='http://<siteCollection>/<teamSite>/newsfeed.aspx'POST http://<siteCollection>/<site>/_api/social.feed/actor(item=@v)/feed/post?@v='http://<siteCollection>/<teamSite>/newsfeed.aspx'

请求参数Request parameter

_restCreationData_

类型: SP.Social.SocialRestPostCreationDataType: SP.Social.SocialRestPostCreationData

新文章的一个 null ID 和属性,如下例所示。A null ID and the properties of the new post, as shown in the following example.

"restCreationData":{
  "__metadata":{
    "type":"SP.Social.SocialRestPostCreationData"
  },
  "ID":null,
  "creationData":{
    "__metadata":{
      "type":"SP.Social.SocialPostCreationData"
    },
    "ContentText":"This post was published using REST.",
    "UpdateStatusText":false
  }
}

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

包含新的根文章的主题。A thread that contains the new root post.

以下响应示例展示了包含新的根文章的主题。The following response example represents the thread that contains the new root post.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b.866d920d78d949a394f26073b767cb19.3.3.1'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b.866d920d78d949a394f26073b767cb19.3.3.1'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b.866d920d78d949a394f26073b767cb19.3.3.1",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":null,
        "ActorType":2,
        "CanFollow":true,
        "ContentUri":"http://serverName:80/sites/teamSite",
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":true,
        "LibraryUri":null,
        "Name":"Team Site",
        "PersonalSiteUri":null,
        "Status":0,
        "StatusText":null,
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/sites/teamSite"
      },{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username1",
        "ActorType":0,
        "CanFollow":false,
        "ContentUri":null,
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":false,
        "LibraryUri":null,
        "Name":"User1 Name",
        "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
        "Status":0,
        "StatusText":"Posted with REST.",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
      }]
    },
    "Attributes":6,
    "Id":"8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b.866d920d78d949a394f26073b767cb19.3.3.1",
    "OwnerIndex":0,
    "Permalink":"http://serverName/sites/teamSite/newsfeed.aspx?ThreadID=8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b.866d920d78d949a394f26073b767cb19.3.3.1",
    "PostReference":null,
    "Replies":{"results":[]},
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":1,
      "CreatedTime":"2013-04-18T22:44:11.8485085Z",
      "Id":"8.c4bb19b167a448a3be9b597522152420.c305b669c2b649e9b820e7feabe3c095.c4bb19b167a448a3be9b597522152420.0c37852b34d0418e91c62ac25af4be5b.866d920d78d949a394f26073b767cb19.3.3.1",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-18T22:44:11.8485085Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":0
  }
}}

文章Post

获取包含指定微博文章的完整主题。Gets a full thread that contains the specified microblog post.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/postPOST http://<siteCollection>/<site>/_api/social.feed/post

请求参数Request parameter

IDID

类型: StringType: String

文章的唯一标识符,如下例中所示。The unique identifier of the post, as shown in the following example.

"ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.644240140e0b43379883ebcb859deaab.27.32.S-1-5-21-2127521184-1604012920-1887927527-66602"

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

包含指定文章的完整主题。A full thread that contains the specified post.

以下响应示例表示包含指定文章的完整主题。与仅包含两个最近的回复的摘要主题不同,完整主题包含所有回复。The following response example represents the full thread that contains the specified post. Unlike digest threads (which contain only the two most recent replies), a full thread contains all replies.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.62bff48184bd433b8f7b04f6ea76268b.27.27.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.62bff48184bd433b8f7b04f6ea76268b.27.27.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.62bff48184bd433b8f7b04f6ea76268b.27.27.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username1",
        "ActorType":0,
        "CanFollow":false,
        "ContentUri":null,
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":false,
        "LibraryUri":null,
        "Name":"User1 Name",
        "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
        "Status":0,
        "StatusText":"Posted with REST.",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
      },{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username2",
        "ActorType":0,
        "CanFollow":true,
        "ContentUri":null,
        "EmailAddress":"username2@somecompany.com",
        "FollowedContentUri":null,
        "Id":"1.ed418efb7f984ee49ce276c9c5441938.de1675d4929d431894c18908ac53516a.65da910de21f4e40abb318ba33520931.0c37852b34d0418e91c62ac25af4be5b","ImageUri":"http://serverName:80/my/User Photos/Profile Pictures/username2_MThumb.jpg",
        "IsFollowed":true,
        "LibraryUri":null,"Name":"User2 Name","PersonalSiteUri":"http://serverName/my/personal/username2","Status":6,"StatusText":"This is post 1 from the specified user.",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":"SOME TITLE",
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername2"
      }]
    },
    "Attributes":6,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.62bff48184bd433b8f7b04f6ea76268b.27.27.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "OwnerIndex":0,
    "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.62bff48184bd433b8f7b04f6ea76268b.27.27.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "PostReference":null,
    "Replies":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialPost"},
        "Attachment":null,
        "Attributes":23,
        "AuthorIndex":1,
        "CreatedTime":"2013-04-23T23:02:40Z",
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.644240140e0b43379883ebcb859deaab.27.32.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "LikerInfo":{
          "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
          "IncludesCurrentUser":false,
          "Indexes":{"results":[]},
          "TotalCount":0
        },
        "ModifiedTime":"2013-04-23T23:02:40Z",
        "Overlays":{"results":[]},
        "PostType":1,
        "PreferredImageUri":null,
        "Source":{
          "__metadata":{"type":"SP.Social.SocialLink"},
          "Text":null,
          "Uri":null
        },
        "Text":"This is a reply."
      }]
    },
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:45:45Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.62bff48184bd433b8f7b04f6ea76268b.27.27.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[1]},
        "TotalCount":1
      },
      "ModifiedTime":"2013-04-23T23:02:41Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":1
  }
}}

Post/ReplyPost/Reply

发布对指定文章的回复。Posts a reply to the specified post.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/replyPOST http://<siteCollection>/<site>/_api/social.feed/post/reply

请求参数Request parameter

_restCreationData_

类型: SP.Social.SocialRestPostCreationDataType: SP.Social.SocialRestPostCreationData

要回复的文章的 ID 以及回复的属性,如下例中所示。The ID of the post to reply to and the properties of the reply, as shown in the following example.

"restCreationData":{
  "__metadata":{
    "type": "SP.Social.SocialRestPostCreationData"
  },
  "ID":"1.4975bef1e1bc42608c1dfae9f320c751.35c9fd7b79904800aaa5f74684bf0f75.623664921f034e8d814c000267d3e5e4.0c37852b34d0418e91c62ac25af4be5b.230d3c5272fc499f88ac0b74b2f4512f.119.119.S-1-5-21-124525095-708259637-1543119021-565461",
  "creationData":{
    "__metadata":{
      "type":"SP.Social.SocialPostCreationData"
    },
    "ContentText":"Posted with REST.",
    "UpdateStatusText":false
  }
}

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

包含指定文章的已修改主题的一个摘要。A digest of the modified thread that includes the specified post.

以下响应示例表示包含指定文章和回复的主题。The following response example represents the thread that contains the specified post and reply.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
      "__metadata":{
        "type":"SP.Social.SocialActor"
      },
      "AccountName":"domain\\username1",
      "ActorType":0,
      "CanFollow":false,
      "ContentUri":null,
      "EmailAddress":null,
      "FollowedContentUri":null,
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
      "ImageUri":null,
      "IsFollowed":false,
      "LibraryUri":null,
      "Name":"User1 Name",
      "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
      "Status":0,
      "StatusText":"Posted with REST.",
      "TagGuid":"00000000-0000-0000-0000-000000000000",
      "Title":null,"Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"}
    ]},
    "Attributes":6,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "OwnerIndex":0,
    "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "PostReference":null,
    "Replies":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialPost"},
        "Attachment":null,
        "Attributes":23,
        "AuthorIndex":0,
        "CreatedTime":"2013-04-17T20:52:51.0650454Z",
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ce3ac812293c4903b5c406efe01b9432.26.29.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "LikerInfo":{
          "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
          "IncludesCurrentUser":false,
          "Indexes":{"results":[]},
          "TotalCount":0
        },
        "ModifiedTime":"2013-04-17T20:52:51.0650454Z",
        "Overlays":{"results":[]},
        "PostType":1,
        "PreferredImageUri":null,
        "Source":{
          "__metadata":{"type":"SP.Social.SocialLink"},
          "Text":null,
          "Uri":null
        },
        "Text":"Replied with REST."
      }]
    },
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:33:17Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-17T20:52:51.6900774Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":1
  }
}}

Post/DeletePost/Delete

删除指定的微博文章。如果文章是根文章,将删除整个主题。Deletes the specified microblog post. If the post is the root post, the whole thread is deleted.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/deletePOST http://<siteCollection>/<site>/_api/social.feed/post/delete

请求参数Request parameter

IDID

类型: StringType: String

要删除的文章的 ID,如下例中所示。The ID of the post to delete, as shown in the following example.


'ID':'1.94fdcc5fc39b4a2c99ae4570caf02321.d0a03fb1761a404a9a8e7f9f5ec58e17.5a1067e8af65410b9e2ba6a74a4b718a.0c37852b34d0418e91c62ac25af4be5b.9dbfb5598e2248d7b57eee57abf2e7c1.31.31.S-1-5-21-124525095-708259637-1543119021-565461'

响应Response

无。None.

{"d":{"Delete":null}}

Post/LikePost/Like

使当前用户成为指定微博文章的关注者。Makes the current user a liker of the specified microblog post.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/likePOST http://<siteCollection>/<site>/_api/social.feed/post/like

请求参数Request parameter

IDID

类型: StringType: String

要喜欢的文章的 ID,如下例中所示。The ID of the post to like, as shown in the following example.

"ID":"1.94fdcc5fc39b4a2c99ae4570caf02321.d0a03fb1761a404a9a8e7f9f5ec58e17.5a1067e8af65410b9e2ba6a74a4b718a.0c37852b34d0418e91c62ac25af4be5b.9dbfb5598e2248d7b57eee57abf2e7c1.31.31.S-1-5-21-124525095-708259637-1543119021-565461"

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

包含指定文章的摘要主题。A digest thread that contains the specified post.

以下响应示例表示包含喜欢的文章的主题。The following response example represents the thread that contains the liked post.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username1",
        "ActorType":0,
        "CanFollow":false,
        "ContentUri":null,
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":false,
        "LibraryUri":null,
        "Name":"User1 Name",
        "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
        "Status":0,
        "StatusText":"Posted with REST.",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
      }]
    },
    "Attributes":6,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "OwnerIndex":0,
    "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "PostReference":null,
    "Replies":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialPost"},
        "Attachment":null,
        "Attributes":23,
        "AuthorIndex":0,
        "CreatedTime":"2013-04-17T20:52:51.0650454Z",
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ce3ac812293c4903b5c406efe01b9432.26.29.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "LikerInfo":{
          "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
          "IncludesCurrentUser":false,
          "Indexes":{"results":[]},
          "TotalCount":0
        },
        "ModifiedTime":"2013-04-17T20:52:51.0650454Z",
        "Overlays":{"results":[]},
        "PostType":1,
        "PreferredImageUri":null,
        "Source":{
          "__metadata":{"type":"SP.Social.SocialLink"},
          "Text":null,
          "Uri":null
        },
        "Text":"Replied with REST."
      }]
    },
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:33:17Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":true,
        "Indexes":{"results":[]},
        "TotalCount":1
      },
      "ModifiedTime":"2013-04-17T20:52:51Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":1
  }
}}

Post/UnlikePost/Unlike

将当前用户从指定微博文章的关注者列表中移除。如果当前用户不是文章的关注者,该请求将忽略。Removes the current user from the list of likers for the specified microblog post. If the current user is not a liker of the post, this request is ignored.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/unlikePOST http://<siteCollection>/<site>/_api/social.feed/post/unlike

请求参数Request parameter

IDID

类型: StringType: String

要喜欢的文章的 ID,如下例中所示。The ID of the post to stop liking, as shown in the following example.

"ID":"1.94fdcc5fc39b4a2c99ae4570caf02321.d0a03fb1761a404a9a8e7f9f5ec58e17.5a1067e8af65410b9e2ba6a74a4b718a.0c37852b34d0418e91c62ac25af4be5b.9dbfb5598e2248d7b57eee57abf2e7c1.31.31.S-1-5-21-124525095-708259637-1543119021-565461"

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

包含指定文章的已修改主题的一个摘要。A digest of the modified thread that includes the specified post.

以下响应示例表示包含用户不再喜欢的文章的主题。The following response example represents the thread that contains the post that the user stopped liking.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username1",
        "ActorType":0,
        "CanFollow":false,
        "ContentUri":null,
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":false,
        "LibraryUri":null,
        "Name":"User1 Name",
        "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
        "Status":0,
        "StatusText":"Posted with REST.",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
      }]
    },
    "Attributes":6,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "OwnerIndex":0,
    "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "PostReference":null,
    "Replies":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialPost"},
        "Attachment":null,
        "Attributes":23,
        "AuthorIndex":0,
        "CreatedTime":"2013-04-17T20:52:51.0650454Z",
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ce3ac812293c4903b5c406efe01b9432.26.29.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "LikerInfo":{
          "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
          "IncludesCurrentUser":false,
          "Indexes":{"results":[]},
          "TotalCount":0
        },
        "ModifiedTime":"2013-04-17T20:52:51.0650454Z",
        "Overlays":{"results":[]},
        "PostType":1,
        "PreferredImageUri":null,
        "Source":{
          "__metadata":{"type":"SP.Social.SocialLink"},
          "Text":null,
          "Uri":null
        },
        "Text":"Replied with REST."
      }]
    },
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:33:17Z","Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-17T20:52:51Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":1
  }
}}

Post/LikersPost/Likers

获取喜欢指定微博文章的用户。Gets the users who like the specified microblog post.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/likersPOST http://<siteCollection>/<site>/_api/social.feed/post/likers

请求参数Request parameter

IDID

类型: StringType: String

要获取其关注者的文章的 ID,如下例中所示。The ID of the post to get the likers for, as shown in the following example.

"ID":"1.94fdcc5fc39b4a2c99ae4570caf02321.d0a03fb1761a404a9a8e7f9f5ec58e17.5a1067e8af65410b9e2ba6a74a4b718a.0c37852b34d0418e91c62ac25af4be5b.9dbfb5598e2248d7b57eee57abf2e7c1.31.31.S-1-5-21-124525095-708259637-1543119021-565461"

响应Response

LikersLikers

类型: SP.Social.SocialActor[]Type: SP.Social.SocialActor[]

喜欢指定文章的用户。The users who like the specified post.

以下响应示例表示喜欢指定文章的用户。The following response example represents the users that like the specified post.

{"d":{
  "Likers":{
    "results":[{
      "__metadata":{"type":"SP.Social.SocialActor"},
      "AccountName":"domain\\username1",
      "ActorType":0,
      "CanFollow":false,
      "ContentUri":null,
      "EmailAddress":null,
      "FollowedContentUri":null,
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
      "ImageUri":null,
      "IsFollowed":false,
      "LibraryUri":null,
      "Name":"User1 Name",
      "PersonalSiteUri":"http://serverName/my/personal/username1/",
      "Status":0,
      "StatusText":"Posted with REST.",
      "TagGuid":"00000000-0000-0000-0000-000000000000",
      "Title":null,
      "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
    }]
  }
}}

Post/LockPost/Lock

锁定指定主题。如果主题已锁定,则不会将回复文章添加到主题中,直至其解锁。Locks the specified thread. If a thread is locked, no reply posts can be added to the thread until it is unlocked.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/lockPOST http://<siteCollection>/<site>/_api/social.feed/post/lock

请求参数Request parameter

IDID

类型: StringType: String

要锁定的主题的 ID,如下例中所示。The ID of the thread to lock, as shown in the following example.

"ID":"1.94fdcc5fc39b4a2c99ae4570caf02321.d0a03fb1761a404a9a8e7f9f5ec58e17.5a1067e8af65410b9e2ba6a74a4b718a.0c37852b34d0418e91c62ac25af4be5b.9dbfb5598e2248d7b57eee57abf2e7c1.31.31.S-1-5-21-124525095-708259637-1543119021-565461"

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

已锁定主题的摘要。A digest of the locked thread.

以下响应示例表示锁定主题。主题的 Attributes 属性包含 SP.Social.SocialThreadAttributes 枚举的按位值,该值将指示主题是否已锁定。The following response example represents a locked thread. The Attributes property of the thread contains a bitwise value from the SP.Social.SocialThreadAttributes enumeration, which indicates whether the thread is locked.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'
    uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
  "__metadata":{"type":"SP.Social.SocialThread"},
  "Actors":{
    "results":[{
      "__metadata":{"type":"SP.Social.SocialActor"},
      "AccountName":"domain\\username1",
      "ActorType":0,
      "CanFollow":false,
      "ContentUri":null,
      "EmailAddress":null,
      "FollowedContentUri":null,
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
      "ImageUri":null,
      "IsFollowed":false,
      "LibraryUri":null,
      "Name":"User1 Name",
      "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
      "Status":0,
      "StatusText":"Posted with REST.",
      "TagGuid":"00000000-0000-0000-0000-000000000000",
      "Title":null,
      "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
    }]
  },
  "Attributes":12,
  "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "OwnerIndex":0,
  "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "PostReference":null,
  "Replies":{
    "results":[{
      "__metadata":{"type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":22,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T20:52:51.0650454Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ce3ac812293c4903b5c406efe01b9432.26.29.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-17T20:52:51.0650454Z",
      "Overlays":{"results":[]},
      "PostType":1,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Replied with REST."
    }]
  },
  "RootPost":{
    "__metadata":{
      "type":"SP.Social.SocialPost"},
      "Attachment":null,
      "Attributes":22,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:33:17Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-17T20:52:51Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":0,
    "ThreadType":0,
    "TotalReplyCount":1
  }
}}

Post/UnlockPost/Unlock

解锁指定主题。Unlocks the specified thread.

终结点 URI 结构Endpoint URI structure

POST http://<siteCollection>/<site>/_api/social.feed/post/unlockPOST http://<siteCollection>/<site>/_api/social.feed/post/unlock

请求参数Request parameter

IDID

类型: StringType: String

要解锁的主题的 ID,如下例中所示。The ID of the thread to unlock, as shown in the following example.

"ID":"1.94fdcc5fc39b4a2c99ae4570caf02321.d0a03fb1761a404a9a8e7f9f5ec58e17.5a1067e8af65410b9e2ba6a74a4b718a.0c37852b34d0418e91c62ac25af4be5b.9dbfb5598e2248d7b57eee57abf2e7c1.31.31.S-1-5-21-124525095-708259637-1543119021-565461"

响应Response

类型: SP.Social.SocialRestThreadType: SP.Social.SocialRestThread

已解锁主题的摘要。A digest of the unlocked thread.

以下响应示例表示解锁主题。主题的 Attributes 属性包含 SP.Social.SocialThreadAttributes 枚举的按位值,该值将指示主题是否已锁定。The following response example represents the unlocked thread. The Attributes property of the thread contains a bitwise value from the SP.Social.SocialThreadAttributes enumeration, which indicates whether the thread is locked.

{"d":{
  "__metadata":{
    "id":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "uri":"http://serverName/sites/dev/_api/social.feed/post(ID=@ai)/?@ai='1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602'",
    "type":"SP.Social.SocialRestThread"
  },
  "ID":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
  "SocialThread":{
    "__metadata":{"type":"SP.Social.SocialThread"},
    "Actors":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialActor"},
        "AccountName":"domain\\username1",
        "ActorType":0,
        "CanFollow":false,
        "ContentUri":null,
        "EmailAddress":null,
        "FollowedContentUri":null,
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b",
        "ImageUri":null,
        "IsFollowed":false,
        "LibraryUri":null,
        "Name":"User1 Name",
        "PersonalSiteUri":"http://serverName:80/my/personal/username1/",
        "Status":0,
        "StatusText":"Posted with REST.",
        "TagGuid":"00000000-0000-0000-0000-000000000000",
        "Title":null,
        "Uri":"http://serverName:80/my/Person.aspx?accountname=domain%5Cusername1"
      }
    ]},
    "Attributes":6,
    "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "OwnerIndex":0,
    "Permalink":"http://serverName:80/my/ThreadView.aspx?ThreadID=1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
    "PostReference":null,
    "Replies":{
      "results":[{
        "__metadata":{"type":"SP.Social.SocialPost"},
        "Attachment":null,
        "Attributes":23,
        "AuthorIndex":0,
        "CreatedTime":"2013-04-17T20:52:51.0650454Z",
        "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.ce3ac812293c4903b5c406efe01b9432.26.29.S-1-5-21-2127521184-1604012920-1887927527-66602",
        "LikerInfo":{
          "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
          "IncludesCurrentUser":false,
          "Indexes":{"results":[]},
          "TotalCount":0
        },
        "ModifiedTime":"2013-04-17T20:52:51.0650454Z",
        "Overlays":{"results":[]},
        "PostType":1,
        "PreferredImageUri":null,
        "Source":{
          "__metadata":{"type":"SP.Social.SocialLink"},
          "Text":null,
          "Uri":null
        },
        "Text":"Replied with REST."
      }]
    },
    "RootPost":{
      "__metadata":{"type":"SP.Social.SocialPost"},

      "Attachment":null,
      "Attributes":23,
      "AuthorIndex":0,
      "CreatedTime":"2013-04-17T19:33:17Z",
      "Id":"1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602",
      "LikerInfo":{
        "__metadata":{"type":"SP.Social.SocialPostActorInfo"},
        "IncludesCurrentUser":false,
        "Indexes":{"results":[]},
        "TotalCount":0
      },
      "ModifiedTime":"2013-04-17T20:52:51Z",
      "Overlays":{"results":[]},
      "PostType":0,
      "PreferredImageUri":null,
      "Source":{
        "__metadata":{"type":"SP.Social.SocialLink"},
        "Text":null,
        "Uri":null
      },
      "Text":"Posted with REST."
    },
    "Status":5,
    "ThreadType":0,
    "TotalReplyCount":1
  }
}}

订阅源任务的示例 REST 请求Example REST requests for feed tasks

GET 订阅源任务请求指定 URI 中的参数或请求的 url 属性中的参数。 POST 请求指定请求正文中的 data 属性的参数,格式为 XML 或 JavaScript 对象表示法 (JSON)。您可以提出任何语言的 HTTP 请求,包括 JavaScript 和 C#。下列示例请求显示如何使用 JavaScript 提出请求,如何传递 JSON 格式的实体信息。GET requests for feed tasks specify parameters in the URI or in the url attribute of the request. POST requests specify parameters in the data attribute of the request body in XML or JavaScript Object Notation (JSON) format. You can make HTTP requests in any language, including JavaScript and C#. The following example requests show how to make requests by using JavaScript and how to pass entity information in JSON format.

示例: 如何在请求正文中指定 ID 参数(在 data 属性中)。Example: How to specify the ID parameter in the request body (in the data attribute).

备注

主题和文章 Id 属性的值太长,无法在 URL 中发送,因此您要在请求正文中发送它们。结果,即使在逻辑上为 GET 请求的只读操作也必须作为 POST 请求发送。例如,若要获取某个主题,您必须发送 POST 请求并将主题 Id 作为一个实体在请求正文中传递。The values of thread and post Id properties are too long to send in a URL, so you have to send them in the request body. As a result, even read-only operations that are logically GET requests must be sent as POST requests. For example, to get a thread, you have to send a POST request and pass the thread Id as an entity in the request body.

var endpoint = siteUrl + '/_api/social.feed/post';
var postId = '1.655c70c348374d48839daabc24a360f0.82baa3bdfa2f481a8185802eb9c6c6cd.5d227a6fa3894f0c9dde26876b71d619.0c37852b34d0418e91c62ac25af4be5b.4316bdaa94bf4984be5dfea1ba96954e.26.26.S-1-5-21-2127521184-1604012920-1887927527-66602';

$.ajax({
    url: endpoint,
    type: 'POST',
    data: JSON.stringify({
        'ID': postId
    }),
    headers: {
        "accept": "application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val()
    },
    success: function(data) {
        var stringData = JSON.stringify(data);
        alert(stringData);

        // Converts the response data into an object that you can work with.
        var jsonObject = JSON.parse(stringData);
    },
    error: function(xhr, ajaxOptions, thrownError) {
        alert("Error: " + xhr.status + " " + thrownError + "\\nResponseText: " + xhr.responseText);
    }
});

示例: 如何发布根帖子,并在 data 属性中指定 restCreationData 参数。Example: How to publish a root post and specify the restCreationData parameter in the data attribute.

var endpoint = <site url> + '/_api/social.feed/my/feed/post';
var postContent = 'Posted with REST.';

$.ajax({
    url: endpoint,
    type: 'POST',
    data: JSON.stringify({
        'restCreationData': {
            '__metadata': {
                'type': 'SP.Social.SocialRestPostCreationData'
            },
            'ID': null,
            'creationData': {
                '__metadata': {
                    'type': 'SP.Social.SocialPostCreationData'
                },
                'ContentText': postContent
            }
        }
    }),
    headers: {
        "accept": "application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val()
    },
    success: function(data) {
        var stringData = JSON.stringify(data);
        alert(stringData);

        // Converts the response data into an object that you can work with.
        var jsonObject = JSON.parse(stringData);
    },
    error: function(xhr, ajaxOptions, thrownError) {
        alert("Error: " + xhr.status + " " + thrownError + "\\nResponseText: " + xhr.responseText);
    }
});

要发布对指定主题的回复,请将 POST 请求发送至 Reply 资源 ( <site url>/_api/social.feed/Post/Reply) 并传递包含目标文章 ID 的 restCreationData 信息。To publish a reply to a specified thread, send a POST request to the Reply resource ( <site url>/_api/social.feed/Post/Reply) and pass restCreationData information that includes the target post ID.

{ "restCreationData": {
    "__metadata": { "type": "SP.Social.SocialRestPostCreationData" },
    "ID":"1.4975bef1e1bc42608c1dfae9f320c751.35c9fd7b79904800aaa5f74684bf0f75.623664921f034e8d814c000267d3e5e4.0c37852b34d0418e91c62ac25af4be5b.230d3c5272fc499f88ac0b74b2f4512f.119.119.S-1-5-21-124525095-708259637-1543119021-565461",
    "creationData":{
        "__metadata":{ "type":"SP.Social.SocialPostCreationData" },
        "ContentText":"This is a reply to the specified post.",
        "UpdateStatusText":false
    }
} }

下列 REST 资源用作客户端请求中的参数,或在服务器响应中返回。The following REST resources are used as parameters in client-side requests or are returned in server responses.

SP.Social.SocialFeedOptionsSP.Social.SocialFeedOptions

表示检索订阅源时可以指定的选项。Represents options that you can specify when retrieving a feed.

对源发出的客户端 GET 请求可以视需要将 SocialFeedOptions 属性指定为参数。这些属性是在查询字符串中进行指定。Client-side GET requests for feeds can optionally specify SocialFeedOptions properties as parameters. These properties are specified in the query string.

选项Option 类型Type 说明Description
MaxThreadCountMaxThreadCount Int32Int32 要检索的最大主题数。默认数量为 20。The maximum number of threads to retrieve. The default number is 20.
NewerThanNewerThan 字符串String 要检索的时间跨度的"newer than"边界,作为 DateTime 对象的字符串表示形式。默认情况下未指定边界。The "newer than" boundary of the time span to retrieve, as a string representation of a DateTime object. The default is no specified boundary.
OlderThanOlderThan 字符串String 要检索的时间跨度的"older than"边界,作为 DateTime 对象的字符串表示形式。默认情况下未指定边界。The "older than" boundary of the time span to retrieve, as a string representation of a DateTime object. The default is no specified boundary.
SortOrderSortOrder Int32Int32 线程在源中的排序顺序。The sort order of the threads in the feed. 默认是按修改日期排序,但时间线源除外,它是按创建日期排序。The default sort order is by modified date, except for the timeline feed, which is sorted by created date.
0 按帖子修改时间由近及远的顺序对线程进行排序。0 sorts threads by modified time, according to the most recent modification times of their posts.
1 根据根帖子的创建时间,按创建时间对线程进行排序。1 sorts threads by created time, according to the creation times of their root posts.

SP.Social.SocialRestActorSP.Social.SocialRestActor

表示用户、文档、站点或标签。Represents a user, document, site, or tag.

服务器在响应中返回 SocialRestActor 资源,以响应客户端对主角信息的请求。The server returns a SocialRestActor resource in the response to a client-side request for actor information.

SocialRestActor 具有以下属性。SocialRestActor has the following properties.

属性Property 类型Type 说明Description
FollowableItemFollowableItem 字符串String 指定主角的唯一标识符。返回用户的帐户名称或文档、站点或标签的 URI。The unique identifier of the specified actor. Returns the account name for a user or the URI for a document, site, or tag.
FollowableItemActorFollowableItemActor SP.Social.SocialActorSP.Social.SocialActor 指定的用户。如果用户是当前用户,或者资源不是用户类型的主角,返回 nullThe specified user. Returns null if the user is the current user or if the resource is not a user-type actor.
MeMe SP.Social.SocialActorSP.Social.SocialActor 当前用户。The current user.

SP.Social.SocialRestFeedSP.Social.SocialRestFeed

表示好友动态订阅源。Represents a social feed.

服务器在响应中返回 SocialRestFeed 资源,以响应客户端对订阅源内容的请求。The server returns a SocialRestFeed resource in the response to a client-side request for feed content.

SocialRestFeed 包含封装的 SP.Social.SocialFeed 对象,它具有以下属性。SocialRestFeed contains a wrapped SP.Social.SocialFeed object, which has the following properties.

属性Property 类型Type 说明Description
AttributesAttributes SP.Social.SocialFeedAttributesSP.Social.SocialFeedAttributes 适用于订阅源的按位属性集。A bitwise set of attributes that apply to the feed.
NewestProcessedNewestProcessed DateTimeDateTime 检索的最新文章的日期和时间。The date and time of the newest retrieved post.
OldestProcessedOldestProcessed DateTimeDateTime 检索的最旧文章的日期和时间。The date and time of the oldest retrieved post.
线程Threads SP.Social.SocialThread[]SP.Social.SocialThread[] 组成订阅源的主题。The threads that make up the feed.
UnreadMentionCountUnreadMentionCount Int32Int32 当前用户提及的未读订阅源数量。The count of unread mentions for the current user.

SP.Social.SocialRestPostCreationDataSP.Social.SocialRestPostCreationData

表示新文章的内容及相关信息。Represents content and related information for a new post.

客户端将 SocialRestPostCreationData 属性指定为请求中用于发布根文章或回复的参数。这些属性在请求正文的 data 属性中指定。Clients specify SocialRestPostCreationData properties as parameters in a request to publish a root post or a reply. These properties are specified in the data attribute of the request body.

SocialRestPostCreationData 包含 ID 属性和包装的 SP.Social.SocialPostCreationData 对象。 ID 为必需, SocialPostCreationData 属性为可选。SocialRestPostCreationData contains an ID property and a wrapped SP.Social.SocialPostCreationData object. ID is required but the SocialPostCreationData properties are optional.

属性Property 类型Type 说明Description
ID(必需)ID (required) nullStringnull or String 帖子的目标。The target destination for the post. 可以取下列值之一:The value can be one of the following:
null :将根帖子发布到当前用户的源null to publish a root post to the current user's feed
要回复的帖子的 IDThe ID of a post to reply to
要发布到的网站源 URL(例如:http://<teamSiteURL>/newsfeed.aspxThe URL of a site feed to post to (for example: http://<teamSiteURL>/newsfeed.aspx)

以下属性属于 SocialPostCreationData 对象。The following properties belong to the SocialPostCreationData object.

属性Property 类型Type 说明Description
AttachmentAttachment SP.Social.SocialAttachmentSP.Social.SocialAttachment 文章的图像、视频或文档附件。An image, video, or document attachment for the post.
ContentItemsContentItems SP.Social.SocialDataItem[]SP.Social.SocialDataItem[] 用于替换文章内容文本中的相应令牌的项目The items to replace the corresponding tokens in the post's content text
ContentTextContentText StringString 文章的纯文本,可能包含位置插入令牌(例如,“今天是 {0} 的生日!”)。The plain text of the post, which can include positional insertion tokens (for example, "Today is {0}'s birthday!").
SecurityUrisSecurityUris String[]String[] 用于定义文章访问权限的 SharePoint 对象的 URI 字符串表示形式。String representations of the URIs to SharePoint objects that define access permissions for the post.
SourceSource SP.Social.SocialLinkSP.Social.SocialLink 文章来源。The source of the post.
UpdateStatusTextUpdateStatusText BooleanBoolean 控制文章的纯文本内容是否应该替换当前用户的状态文本的值。A value that controls whether the post's plain-text content should replace the current user's status text.

SP.Social.SocialRestThreadSP.Social.SocialRestThread

表示包含根文章和回复集的主题。Represents a thread that contains a root post and a set of replies.

服务器在响应中返回 SocialRestThread 资源,以响应创建文章或获取完整主题的客户端请求。The server returns a SocialRestThread resource in the response to a client-side request to create a post or to get a full thread.

SocialRestThread 包含 ID 属性和封装的 SP.Social.SocialThread 对象。SocialRestThread contains an ID property and a wrapped SP.Social.SocialThread object.

属性Property 类型Type 说明Description
IDID 字符串String 主题的唯一标识符。The unique identifier of the thread.

以下属性属于 SocialThread 对象。The following properties belong to the SocialThread object.

属性Property 类型Type 说明Description
ActorsActors SP.Social.SocialActor[]SP.Social.SocialActor[] 合并的参与主角阵列。The merged array of participating actors.
属性Attributes Int32Int32 表示主题属性集的按位值。请参阅 SP.Social.SocialThreadAttributesThe bitwise value that represents the set of attributes for the thread. See SP.Social.SocialThreadAttributes.
IdId 字符串String 主题的唯一标识符。The unique identifier of the thread.
OwnerIndexOwnerIndex Int32Int32 主题的主角中主题所有者的索引。The index of the thread's owner within the thread's actors.
PermalinkPermalink 字符串String 直接浏览到主题的稳定 URI(如果可用)的字符串表示形式。The string representation of the stable URI for navigating directly to the thread, if one is available.
PostReferencePostReference SP.Social.SocialPostReferenceSP.Social.SocialPostReference 引用的文章。The referenced post.
回复Replies SP.Social.SocialPost[]SP.Social.SocialPost[] 对主题的回复。The replies to the thread.
RootPostRootPost SP.Social.SocialPostSP.Social.SocialPost 主题的根文章。The root post of the thread.
状态Status Int32Int32 用于识别在主题检索过程中发生的可恢复错误的代码。请参阅 SP.Social.SocialStatusCodeThe code that identifies recoverable errors that occurred during thread retrieval. See SP.Social.SocialStatusCode.
ThreadTypeThreadType SP.Social.SocialThreadTypeSP.Social.SocialThreadType 主题类型。The thread type.
TotalReplyCountTotalReplyCount Int32Int32 主题回复总数。The count of the total number of replies for the thread.

另请参阅See also