-->

Yammer REST API - Message Likes

2019-06-12 03:52发布

问题:

My goal is to get the users who liked each message/comment, and when the like occurred. Currently when querying the Messages endpoint each message has a section called liked_by that contains a count of the total likes on each message/comment, and an array of users that liked the message/comment. However, what I am seeing is that the array with the list of users can not return more than 4 users in the array, even though the message/comment has a total of more than 4 likes. Specifically, if the message/comment has exactly 4 likes, then 4 users are returned in the array. However if the message/comment has greater than 4 likes, only 3 users are returned in the array.

Is there a way to get the Messages endpoint to return all the users who liked each message/comment in the array? Or is there possibly another way to pull message/comment likes with what message/comment was liked, by what user it was liked by, and at what time the like occurred?

Thanks!

回答1:

The Yammer API will only return users that have liked a message as follows:

1 - If three people like a message, display all three

2 - If four people like a message, display all four

3 - If five people or more like a message, display three and use the front-end code to say "x, y, z and n others liked this" (where n = total number of likes minus 3)

There is no workaround that I can find to display all the users that liked a particular message.



回答2:

four years later there is a workaround for this, please see this answer:

See here for further details - https://developer.yammer.com/docs/usersliked_messagemessage_idjson



标签: yammer