404 Error


Thanks for the Yammer library, Nabil ... looks like it will greatly help me do many things with Yammer. At the moment, however, I cannot get it to work. One of the REST calls returns a 404 from the Yammer server. Let me elaborate ...

The error occurs within the Client.Login method. It makes the first call to https://www.yammer.com/dialog/oauth fine and retrieves the AuthenticityToken fine. However, it then tries to make the second call to https://www.yammer.com/session and fails. Specifically, the method Helper.MakePostRequest throws an exception on the following line:

Constants.wResp = (HttpWebResponse)Constants.wr.GetResponse();

The exception message is:

System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at YammerSDK.Helpers.Helper.MakePostRequest(String postBody, String url, String method, String authHeader, String contentType) in e:\webs\YammerSDK\YammerSDK\Helpers\Helper.cs:line 71

I have created the app within my Yammer network and copied my client id, client secret, and redirect into my C# code. I have also attached my C# console app code ...

Any ideas?

  • Joe

file attachments


nabilbabaci wrote Aug 17, 2014 at 12:05 PM

Ok i see what you're trying to do.
In fact it requires that you connect on the Original Network attached to your email.
All the problems comes from the Session. Because Really we're asking each time that we connect a new Session.
So What you need to do, is connect to yammer by the Web. go to your original Network and close it.
Run you Console Code and Use Fiddler for seeing if the Url Redirection contain s you're last Network Visited.
And then normally it's done.
The url that i use is the book is " https://www.yammer.com" that's it.

Once you get your token you can pass it everywhere.

dynamicishwar wrote Oct 9, 2014 at 7:43 AM

Hi Joe,

I recently had to leverage this API as well as made a couple of changes to it to suit my needs. On a quick note you will have to debug the response for the client code, there is a small issue there. If you do not get the client code via this SDK, you can ditrectly fetch the accesstoken via http requests over the browser and then leverage the same, i did not have the time or patience to do so.....but you can basically triage the response you get for the access token...