我能夠發佈消息,但是當我添加任何附件或pending_attachment,我得到一個錯誤說:上傳通過Yammer的API文件
類型錯誤:「升壓」調用的對象不落實接口HTMLInputElement。
function post() {
yam.getLoginStatus(function(response) {
if (response.authResponse) {
yam.request(
{ url: "https://api.yammer.com/api/v1/messages.json" //note: the endpoint is api.yammer...
, method: "POST"
, data: {
"body" : document.getElementById("post_body").value,
"group_id" : document.getElementById("group_id").value
,"attachment1" : document.getElementById("attachment")
}
, success: function (msg) {
alert("Post was Successful!: " + msg.messages[0].id); //id of new message
}
, error: function (msg) { alert("Post was Unsuccessful..." + msg); }
}
);
} else {
yam.login(function (response) {
//nothing
});
}
});
}