Yammer API - List of groups for each user

我与影子孤独终老i 提交于 2019-12-12 09:55:52

问题


I would like to get the list of groups that every user in the yammer instance belongs to. Currently it looks like the user object from both the data export API and the REST API do not contain a section with which groups each user belongs to. I know that there is a way to see what groups I belong to in the REST API, but that does not seem to give the groups for every user in the yammer instance.

Does anybody know if there is a way to get the list of all groups that each and every user in the yammer instance belongs to using either of the APIs?

Thanks!


回答1:


I found that if you have the full list of group IDs (either from the data export api or the rest api), you can use those group IDs to individually query, and page through the following endpoint on the REST API.

https://www.yammer.com/api/v1/users/in_group/[group_id].json?page=[page_number]




回答2:


A fairly easy way to do this would be to get the list of groups:

https://www.yammer.com/api/v1/groups.json

And then iterate over the group IDs returned to get the list of members of each group:

https://www.yammer.com/api/v1/groups/{group id}/members.json

Bear in mind, unless you have proper access you may not be able to see into private groups to get the list of members.



来源:https://stackoverflow.com/questions/25150035/yammer-api-list-of-groups-for-each-user

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!