我能够将消息发布到 yammer,但消息被发布到默认网络,我需要在不同的网络中发布。
这是我当前的测试代码:
<html>
<head>
<title>A Yammer App</title>
<script src="https://assets.yammer.com/platform/yam.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
yam.config({appId: "######"});
</script>
</head>
<body>
<button onclick='post()'>Yammer Update!</button>
<script>
function post() {
yam.getLoginStatus( function(response) {
if (response.authResponse) {
postdata();
} else {
yam.login( postdata);
}
});
}
function postdata()
{
yam.request(
{ url: "https://www.yammer.com/api/v1/messages.json"
, method: "POST"
, data: { "body" : "Message Throug app","group_id":"3156478"}
, success: function (msg) { alert("Post was Successful!: " + msg); }
, error: function (msg) { alert("Post was Unsuccessful..." + msg); }
}
);
}
</script>
</body>
</html>