-->

Yammers REST API to Share a Post

2019-02-21 06:08发布

问题:

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.



标签: api rest yammer