As we know, we can post/reply a post in Newsfeed for my site, but how can we apply by JS? SharePoint provide the REST API for developer to apply it.
You can use the SharePoint 2013 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 HTTPGET andPOST requests to the resource endpoints that represent the tasks you want to do
The endpoint URIs for most feed tasks begin with the SocialRestFeedManager resource (social.feed), followed by themy resource or thepost resource:
-
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.
here is the result:
a. Create the UI via html
b. New and Reply a post via my js code