I am currently working on a project that requires using the Yammer API. The intent is to bypass using a browser, and use HttpWebRequest to do all authentication. Originally, this was working for me, but now I get a 404 error when I try to call GetResponse().
For my URL, I have tried using
https://www.yammer.com/session?client_id={CLIENT_ID}
as well as
https://www.yammer.com/session
using (var stream = webrequest.GetRequestStream())
{
stream.Write(postdata, 0, postdata.Length);
}
try
{
webresponse = webrequest.GetResponse() as HttpWebResponse;
}
catch (WebException ex)
{
webresponse = ex.Response as HttpWebResponse;
}
Have they changed the URL or am I doing something wrong?
The following is my code snippet for yammer authentication. Steve Pescha's article - http://blogs.technet.com/b/speschka/archive/2013/10/05/using-the-yammer-api-in-a-net-client-application.aspx explains how to perform Programmatic yammer authentication. I have customized it according to my needs.
In the above code replace your client Id, client secret, email and password. Then you can use the connect method to get the bearer token and disconnect to log out of yammer. Recently yammer changed the number of cookies that were passed back and forth and I have fixed the issue