function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
manimmanim 

Chatter REST API for getting popular post

Is there an API to get most popular posts depending on the likes received?

cloudcodercloudcoder

There is not a specific resource, but you can do it using the standard REST API query capability.

 

LMK if you need the SOQL. I have it lying around somewhere.

manimmanim

Thanks for your reply.

Could you please let me know about it.

It would really be a great help for me.

Thanks.

 

cloudcodercloudcoder

Check out the getRecipeEightTopPosters()  method from Chatter Commons:

 

http://code.google.com/p/chatter-commons/source/browse/trunk/src/classes/ChatterRecipesController.cls

 

manimmanim

Thanks for your reply.I gone through the link you gave.

It mentions about Apex api.

How do we do this using chatter REST API? I have a sample web application which uses chatter REST API?

My requirement is to fetch posts for e.g.in last 3 months from all the users in my group.

Thanks.

 

cloudcodercloudcoder

you just need to use the SOQL query from the code sample I posted you to and use the search support in the REST API.

 

eg:

 

/services/data/v20.0/query?q=SELECT Name from Account Limit 100 

 

Just remember that you will need to URL Encode your query string (I left it out in the example above just to make it easier to read)