2

The case is that we have a SharePoint Online site which allows external access by invitation only. In Yammer we have created a group for external users and have successfully added external users. From Yammer you can embed the code and paste it to a script editor web part, which works properly.

The embedded link

enter image description here

The default embed-code

<div id="embedded-feed" style="height:800px;width:400px;"></div>
<script type="text/javascript" src="https://s0.assets-yammer.com/assets/platform_embed.js"></script>
<script type="text/javascript">
yam.connect.embedFeed({
  container: "#embedded-feed",
  network: "externalcompany.com",  // source network contoso.com
  feedType: "group",
  feedId: "1234567"
});
</script>

The Yammer feed (IT Pro Network as example)

enter image description here

Now, with external users they are a part of their own Yammer network with the URL https://www.yammer.com/externalcompany.com and not the company that hosts the group https://www.yammer.com/contoso.com This make the embedded script fail. So I need to add a variable in the network section of the embedded code. Something like . . .

yam.connect.embedFeed({
  container: "#embedded-feed",
  network: company, // instead of network: "externalcompany.com"
  feedType: "group",
  feedId: "1234567"
});

Is there a way to grab the external user network from their company e-mail address (or something) and assign it to the company variable?

1

Even if you could somehow reliably grab the current user's home network, this approach will not work. The embed is going to look for a group on the specified network with the specified ID, and that group does not exist on those other networks. You need to specify the network that hosts the group in your embed code.

If the external users are part of the yammer group in question, it should just work for those users by specifying the host network.

A couple of suggestions:

  • Try ensuring that your users are logged in to your network in the Yammer web UI and see if you get different results.
  • Try Fiddling the web traffic to see if you can glean any details about the errors thrown in the API calls.

The Yammer APIs are notoriously brittle, and often fall apart when exposed to non-trivial applications. External networks are one area where I've experienced pain in the past.

Good luck!

  • It works for internal users with company.com and extrenal users with externalcompany.com, and that's why I need the yammer network of each user. But the best would be a single entity where both internal and external users are invited to get this to work. Like the IT Pro Network. – Benny Skogberg Jun 22 '16 at 20:29
  • Oh, I did not think it would work like that. Sorry, I'm not aware of any way to fetch users' home networks. – Derek Gusoff Jun 23 '16 at 12:48
  • Often users home network is the same as their domain as in name@company.com - and we can get users info from SPServices from spservices.codeplex.com (I've used that in another O365 environment). But never together with Yammer :) – Benny Skogberg Jun 23 '16 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.