Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Not able to fetch comments from user profile social database

$
0
0

Hi All,

I want to fetch comments entered using SocialCommentControl from user profile social database. I tried following snippet in Managed CSOM API but could not succeed. Any help will greatly appreciated.

System.Net.NetworkCredential cred = new System.Net.NetworkCredential("domain\\useracc", "pass@word1");
            ClientContext clientContext = new ClientContext("http://testsitecollection/");
            clientContext.Credentials = cred;
            PersonProperties owner = new PeopleManager(clientContext).GetPropertiesFor("domain\\useracc");
            MicrofeedManager mgr = new MicrofeedManager(clientContext);
            clientContext.Load(mgr, f => f.CurrentUser);
            clientContext.Load(owner);
            clientContext.ExecuteQuery();
            MicrofeedRetrievalOptions optn = new MicrofeedRetrievalOptions();
            optn.ContentOnly = true;
            optn.IncludedTypes = MicroBlogType.All;
            optn.ResultSortOrder = MicrofeedSortOrder.CreatedTime;
            optn.NewerThan = DateTime.Today.AddDays(-2);
            ClientResult<MicrofeedThreadCollection> res = mgr.GetMyConsolidatedFeed(optn);
            clientContext.ExecuteQuery();

Thanks. 

Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>