我試圖用Open Graph寫入Yammer Activity Feed,但是我得到了400錯誤的請求錯誤。我想知道如果網址或數據是錯誤的。Yammer打開圖形API錯誤400
function postToActivity() {
yam.getLoginStatus(function(response) {
if (response.authResponse) {
yam.request(
{ url: "https://api.yammer.com/api/v1/activity.json" //note: the endpoint is api.yammer...
, method: "POST"
, data: {
"activity" : {
"actor" : {
"name" : "Ken Domen",
"email" : "[email protected]",
"action" : "like",
"object" : {
"url" : "http://www.google.com",
"title" : "Test"
}
}
}
}
, 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
});
}
});
}
謝謝!這工作! – kendomen