如何使用访问令牌从yammer中嵌入Feed来跳过yammer登录? 我有yammer登录的访问令牌。我需要使用访问令牌获取yammer feed。
答案 0 :(得分:0)
<div id="embedded-feed" style="height:800px;width:400px;"></div>
<script type="text/javascript" src="https://assets.yammer.com/assets/platform_embed.js"></script>
<script type="text/javascript">
yam.connect.embedFeed({
container: "#embedded-feed",
network: "{rede}",
feedType: "{type}",
feedId: "{id}"
});
</script>
答案 1 :(得分:0)
您可能需要使用angularJS或纯JS将预先获取的令牌作为承载令牌发送到授权标头中。类似的东西:
function YammerGetMsgCtrl($scope, $http ) {
$http.get('https://api.yammer.com/api/v1/messages.json', {headers: {'Authorization': 'Bearer TOKEN_VALUE'}}).
success(function(data) {
$scope.messages = data;
console.log($scope.messages)
});
}
有关详细信息,请参阅此博客文章 - http://blogs.technet.com/b/israelo/archive/2015/02/24/consuming-yammer-restful-api-with-angularjs-for-dummies.aspx