Project Description

This project is a REST API wrapper and data synchronization library for Yammer that can be used from .NET applications.

Attribution

Starting point for this project was the YammerCrawlSync-Project published by Steve Peschka in his blog post "Using the Yammer API in a .NET Client Application".

He encourages his readers with

"I think as you look into building with the Yammer API you will be able to use the sample application I’ve attached to this posting as a good starting point and pattern for creating whatever custom Yammer application you like. Now go get Yammered. :-)"

And here we are. The sample application has been split into sample and library and has got some new methods. Some parts are untouched though and still need some work.

Big thanks to Steve for providing a starting point!

REST API wrapper

Contained are wrapper classes for Yammer objects as well as classes supporting connecting to Yammer with a given user name and password.

Attention: the code connecting to Yammer automates some steps the user normally would do in the web UI and might break in the future when Yammer changes internals of the log-in process. Read this blog post for background information.

A list of things you can get from Yammer using this lib:
  • list of networks the user has access to (main network, external networks)
  • messages
  • groups
  • group members
  • all users
  • file attachments of messages
Per default you get this information for the users main network. You can choose an external network simply by providing a different token. Tokens for external networks are included in the list of networks.

Be sure to retrieve the data in compliance with Yammers Terms of Use.

Data Synchronization

I needed to download data from Yammer to store and analyze it locally. After looking around for a good storage place my choice fell on MongoDB, a NoSQL database - and I don't regret it.

There are helper classes to connect to a MongoDB instance and to store downloaded data in there. Getting and storing messages is as simple as:

var messages = yammer.ReadAllMessages();
db.AddOrUpdateMessages(messages);

Be sure to use the data in compliance with Yammers Terms of Use.

Getting Started

The demo application has two prerequisites.

Step 1 (mandatory)

To connect to Yammer with an app (e.g. the sample app of this project) you need a Client ID and Client Secret which you get here by registering your app. You also need a working Yammer login which you should already have.

Note: In the app reg UI enter "https://localhost" as the "Experienced redirect" URL.

Step 2 (optional)

The demo application stores data to MongoDB. For this to work you need a MongoDB instance running locally on default port. Download MongoDB here. Unzip it to a local folder and start the server:

mongod --dbpath "C:\data"

Replace C:\data with the directory you want MongoDB to store the database in. That really is all there is to it.

For database management I recommend MongoVUE which so far worked excellently.

If you don't want to store the data locally you need to comment out the respective parts of the demo application.

Last edited Feb 22, 2014 at 9:10 PM by TObject, version 30