Yammers REST API to Share a Post

≯℡__Kan透↙ 提交于 2019-12-01 13:07:24

问题


I want to use REST API to share a post (Not posting a new message but sharing existing post) from my line of business application. Does anybody know which endpoint to use and how it can be achieved.


回答1:


When you use the Yammer API to create a new post, pass the argument :shared_message_id with the message_id of the message you want to share.

For example, in Ruby, you could do this:

require 'yammer'
group_id = '123456'
shared_message_id = '7890123'
yam = Yammer::Client.new(:access_token => 'OAUTH_TOKEN')
yam.create_message('Message text to accompany the shared post', :group_id => group_id, :shared_message_id => shared_message_id)

This will post a new message in the group specified by group_id with the standard shared message view.

You will have to change OAUTH_TOKEN above to the oauth token for your user account, or to your app's token.



来源:https://stackoverflow.com/questions/25564330/yammers-rest-api-to-share-a-post

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