Question

My goal is to gather the count of likes on every non-private message and comment in a Yammer instance (across all networks). I can currently pull all messages for a Yammer instance with the data export API, but unfortunately it does not contain the like count for the messages. I can also successfully page through messages via the REST API, however the only options for pulling messages appears to be only the original message with no comments, or the original messages, and the first 2 comments on each message. Furthermore, after about 2.5 months of messages, no additional messages are returned once you hit a message ID around the 2.5 month mark.

So my questions are as follows:

  1. Is there a way to pull all the non-private original messages and ALL their comments via the REST API in order to get the count of likes and content type?
  2. Is there a way to pull messages and comments via the REST API that are older than 2.5 months (or 3 months)? I would like to get all messages and comments from the beginning of time for a Yammer instance.

Thank you! Nick

Was it helpful?

Solution

For (1), use the /api/v1/messages/in_thread/{thread id}.json endpoint. You will get something like the last 20 messages (I forget if it includes the original message or not). Then, play with the older_than query parameter to get older messages within the thread, where you provide it the oldest message id you got from the previous response. – mleroy Jul 28 at 21:08

Thanks mleroy for your answer!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top