5

I have added a Noteboard Web Part in my page. Now user is adding comments in Noteboard Web Part. I want those comments count. How can I get it using JavaScript?

I am using SharePoint 2013. Is there any way to get Social Comments using SharePoint 2013 Search or by using REST?

1 Answer 1

1

If you are using SharePoint 2013 you should be using the Newsfeed, not the Noteboard. The Newsfeed (both the Feature and the Web part) are part of the 2013 Social API.

Depending on whether you are using the Site Newsfeed or the Farm Newsfeed (hosted on the My Site Host) you will use different Social API calls through the Client Side Object Model (CSOM). You can hit the Social API from .Net, JavaScript and REST.

An Example REST call would be: http://<siteCollection>/<site>/_api/social.feed/my/feed

You can also get Followers, Posts, Likes, Etc.

You can find more details here: MSDN

If you are stuck in 2010 you have to use the older technique of using the User Profile Service. Get a user Profile and then grab the SocialTagManager. Something like this. Retrieve Tags and Notes. Be careful though, the User Profile Service is notorious for poor performance under load. That's why they completely changed the architecture in 2013.

2
  • Thanks Matthew for your reply but I have something different requirement. I have a pages library and in its pages Noteboard web part is added. Now different users are adding their comments in that web part and I want count of all those comments using REST and from code you have provided will get social feed for only current user and that is not my requirement. Commented Jan 27, 2014 at 7:04
  • 1
    Like I said, I believe that the NoteBoard uses the older 2010 API and does not participate in the new 2013 Social API. In 2010 Tags and Notes are managed through the User Profile Service and are stored in the Social Database, in 2013 all Newsfeed activity is stored on the Personal Site. I updated my answer for the 2010 scenario. Commented Jan 28, 2014 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.