Search code examples
javascriptyammersocial-media

Yammer share and embedding the comments on a web application


I am facing an issue related to the yammer integration, want to share the articles to yammer.com from my web app and embed the comments of corresponding article to my web app.

I was able to publish & share the link to Yammer using JS SDK code as below,

yam.platform.yammerShareOpenPopup(options);

but it is not returning any feedId or threadId of the shared item.

   /* Like to have this kind of API to get the FeedId and ThreadId of the post */ 

    yam.platform.yammerShareOpenPopup(options).then((feedId,threadId)=>{

         // lot of codes
    });

How can I get the feed Id and thread Id after sharing the post, or Is there any REST API available to share and get the feedID/ThreadID? I have searched many related Q&As and Yammer Docs, but bad luck I couldn't find any answers or APIs.

Please share your thoughts, any comments or links also be helpful.

Thank you.


Solution

  • When you post a message with the Yammer Share Button you don't get this information by design. It's connecting into what was originally the bookmarklet page for Yammer (/message/new). Only yam.platform.yammerShare() is the documented (read: supported) API.

    If you want to post a message and get information back you need to make a direct call to the REST API. Try out posting messages from the Developer Center and you'll see something like the following:

    enter image description here

    You can see that you get back various pieces of metadata that you are looking for including Thread ID. The trade-off here is that the Share button is simple, but basic. With the REST API (using server-side code, or the JS SDK) you can have greater capabilities and control.