Yammer API - Creating a post on Yammer -
Yammer API - Creating a post on Yammer -
i'm trying utilize yammer api create post on yammer, have next code:
<!doctype html> <html lang="en" xmlns="http://www.w3.org/tr/html5/"> <head> <meta charset="utf-8" /> <title>yammernotification - version 1</title> <script src="https://assets.yammer.com/platform/yam.js"></script> <script> yam.config({ appid: "app-id" }); </script> </head> <body> <button onclick='post()'>post on yammer!</button> <script> function post() { yam.getloginstatus(function (response) { if (response.authresponse) { yam.request( { url: "https://www.yammer.com/api/v1/messages.json" , method: "post" , data: { "body": "this post made using yammer api. welcome yammer api world." } , success: function (msg) { alert("{post successful!}: " + msg); } , error: function (msg) { alert("post unsuccessful..." + msg); } } ) } else { yam.login(function (response) { if (!response.authresponse) { yam.request( { url: "https://www.yammer.com/api/v1/messages.json" , method: "post" , data: { "body": "this post made using yammer api. welcome yammer api world." } , success: function (msg) { alert("{post successful!}: " + msg); } , error: function (msg) { alert("post unsuccessful..." + msg); } } ); } }); } }); } </script> </body> </html>
although app id be? , how tell grouping want set post to?
any suggestions appreciated
yammer ...what app id be?
you'd need register app documented here - https://developer.yammer.com/introduction/#gs-registerapp , app id client id's value
and how tell grouping want set post to?
specify groupid in json info input:
data: { "body": "this post made using yammer api. welcome yammer api world." ,"group_id" : groupid }
see total sample code here - http://blogs.technet.com/b/israelo/archive/2014/10/21/yammer-js-sdk-for-dummies.aspx
yammer
Comments
Post a Comment