I'm trying to write to the Yammer Activity Feed using Open Graph but I get 400 Bad Request Error. I'm wondering if the url or data is wrong.
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" : "ken.domen@nike.com",
"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
});
}
});
}