o365con14 - a developer jam with yammer

30
A developer jam with Yammer Getting started with Yammer integration March 2014

Upload: nccomms

Post on 09-May-2015

319 views

Category:

Presentations & Public Speaking


1 download

DESCRIPTION

European Office 365 Connect 2014 Presentation

TRANSCRIPT

Page 1: O365con14 - a developer jam with yammer

A developer jam with Yammer

Getting started with Yammer integration

March 2014

Page 2: O365con14 - a developer jam with yammer
Page 3: O365con14 - a developer jam with yammer

Agenda

Integration ScenariosGetting StartedApp registration and authenticationWorking with EmbedWorking with RESTWhat is Open Graph?ResourcesQuestions

Page 4: O365con14 - a developer jam with yammer

About me

Focus on SharePoint Architecture and

Development

SharePoint Server MVP since 2013

SharePoint MCT, MCTIP, MCPD

CEO of NUBO GmbH – Munich

patrick.nubo-corp.com

patrick.lamber

[email protected]

Page 5: O365con14 - a developer jam with yammer

Integration Scenarios

2. Office 365 feed integrationMore integration will follow in the next couple of months (not handled here)

1. System independent. Access by code SharePoint, ASP.NET, PHP, …. (handled in this session)

Page 6: O365con14 - a developer jam with yammer

Getting started – In a nutshell

Register app AuthenticateAccess/Post data

to Yammer

Onlinehttps://www.yammer.com/client_applications

Client-side flow Embed

Server-side flow REST API

Realtime

Page 7: O365con14 - a developer jam with yammer

Where are we now?

Register appRegister app AuthenticateAccess/Post

data to Yammer

Page 8: O365con14 - a developer jam with yammer

Register your app

Register app

1) Registration under https://www.yammer.com/client_applications

2) Remember the Client ID

Register app AuthenticateAccess/Post

data to Yammer

Page 9: O365con14 - a developer jam with yammer

Prepare your app

Register app

Register app AuthenticateAccess/Post

data to Yammer

3) Add JavaScript reference to your page

<script type="text/javascript" src="https://assets.yammer.com/platform/yam.js"></script>

4) Associate the Client ID on your page

<script type="text/ecmascript">yam.config({ appId: "YOUR CLIENT ID" });

</script>

Page 10: O365con14 - a developer jam with yammer

Where are we now?

Register appRegister app AuthenticateAccess/Post

data to Yammer

Page 11: O365con14 - a developer jam with yammer

Authentication flow (1/2)

Authentication through OAuth2

Server-side flow (“Authorization Code Grant”): Appropriate

when calling Yammer API through server side code

Client-side flow (“Implicit Grant”): Appropriate when calling

Yammer API through client-side code (web browser)

Register app AuthenticateAccess/Post

data to Yammer

User Authentication

App authorization App authentication

Page 12: O365con14 - a developer jam with yammer

Authentication flow (2/2)

Register app

Register app AuthenticateAccess/Post

data to Yammer

Page 13: O365con14 - a developer jam with yammer

Demo

Setup the environment and authenticate with client-side flow

Register app AuthenticateAccess/Post

data to Yammer

Page 14: O365con14 - a developer jam with yammer

Where are we now?

Register appRegister app AuthenticateAccess/Post

data to Yammer

Page 15: O365con14 - a developer jam with yammer

Working with Embed

Register app

Feeds(My Feed, Group Feed, Topic Feed, User Feed, OG

Object Feed)

Action Buttons

CommentingEvents

(Error, Login, Logout, Loading Competed)

Embed

Register app AuthenticateAccess/Post

data to Yammer

Page 16: O365con14 - a developer jam with yammer

Feeds

Register app

Register app AuthenticateAccess/Post

data to Yammer

<script type="text/javascript">yam.connect.embedFeed({container: '#myFeed',network: 'lamber.eu',config: {

header: true,footer: false,promptText: "Comment on the site feed"

}});

yam.connect.embedFeed({container: "#groupFeed",network: "lamber.eu",feedType: "group",feedId: "3313365",config: {header: false,footer: false,promptText: "Comment on the group feed"

}});

</script>

Page 17: O365con14 - a developer jam with yammer

Action buttons and Comments

Register app

Register app AuthenticateAccess/Post

data to Yammer

<script type="text/javascript">yam.connect.actionButton({container: "#myLike",network: "lamber.eu",action: "like"

});

yam.connect.actionButton({container: "#followMe",network: "lamber.eu",action: "follow"

})</script>

<script type="text/javascript">yam.connect.embedFeed({container: "#commenting",feedType: "open-graph",config: {header: false,footer: false

}});

</script>

Embed

Yammer

Page 18: O365con14 - a developer jam with yammer

Demo

Working with Embed

Register app AuthenticateAccess/Post

data to Yammer

Page 19: O365con14 - a developer jam with yammer

Working with REST

User needs to be authenticated to a network

Use “jam.request” function in the JavaScript SDK

Not all CRUD operations are available (e.g., no way to create

groups)

Register app AuthenticateAccess/Post

data to Yammer

Users

Messages

Attachments

SuggestionsNetworks

GroupsLikes

SubscriptionsTopics

Relationships

Notifications

Autocomplete

Search

Page 20: O365con14 - a developer jam with yammer

Working with REST

Register app AuthenticateAccess/Post

data to Yammer

Autocomplete: 10 requests in 10 seconds.

Messages: 10 requests in 30 seconds.

Notifications: 10 requests in 30 seconds.

All Other Resources: 10 requests in 10 seconds.

Notes

Endpoints returning a status code of 429 (Too Many Requests) when exceeding

limits

Rate limits are per user per app

Limits are independent from each other

Page 21: O365con14 - a developer jam with yammer

Examples of REST calls

Register app

Register app AuthenticateAccess/Post

data to Yammer

Delete

Write messageRead message

Page 22: O365con14 - a developer jam with yammer

Demo

Working with REST

Register app AuthenticateAccess/Post

data to Yammer

Page 23: O365con14 - a developer jam with yammer

What is Open Graph?

Register app

Register app AuthenticateAccess/Post

data to Yammer

Open Graph (OG) is used to define an activity which is posted to Yammer.

Allow users to see the activities of members and increase app usage

You can use “out-of-the” box activities or create your own

The activity takes the format:

<Actor> <Action> <Object> on <App Name>: <Message>

Page 24: O365con14 - a developer jam with yammer

Open Graph Parameters

Register app

Register app AuthenticateAccess/Post

data to Yammer

Actions

• Create

• Update

• Delete

• Follow

• like

Object types

• Page

• Place

• Person

• Department

• Team

• Project

• Folder

• Etc.

Objects

• url

• Type (defaults to page)

• Title

• Image

• Description

Page 25: O365con14 - a developer jam with yammer

Example for posting an activity

Register app

Register app AuthenticateAccess/Post

data to Yammer

var messageObject = {"activity": {

"actor": { "email": "[email protected]" },"action": "follow","object": {

"url": "http://en.wikipedia.org/wiki/Flower_power","title": "The history of Flower Power"

},"message": "This is a great site to start with"

}}

yam.request({url: "/api/v1/activity.json",method: "POST",data: messageObject,success: function (user) {

},error: function (user) {

$("#results").html('An error has occurred');}

});

Page 26: O365con14 - a developer jam with yammer

Demo

Create out-of-the-box and custom objects with Open Graph

Register app AuthenticateAccess/Post

data to Yammer

Page 27: O365con14 - a developer jam with yammer

Tips

Use Yammer SDK to simplify authenticationSubscribe to the Yammer Developer Network on YammerFor testing create your own network with test usersAn enterprise subscription is not necessary when starting with the development. For “complex” impersonation scenarios consider enterprise licensesUse a combination of REST and Embed to build you application

Page 28: O365con14 - a developer jam with yammer

Key takeaways

Yammer provides feed and REST APIs to access data

Authentication can be solved by using either client side code oder server side code

Once authentication is solved, accessing Yammer data is pretty simple

Not all interfaces are available to access or post data

Page 29: O365con14 - a developer jam with yammer

Resources

Open Graph Protocol (bit.ly/1gNT7ad)

Developer reference Yammer (http://bit.ly/1p9YDIL)

Yammer Blog (http://bit.ly/Nt1e4l)

Yammer Developers Network (http://bit.ly/1l2EyGU)

Yammer releases (http://bit.ly/1nCRc1o)

Yammer Office 365 support (http://bit.ly/1donbbQ)

Example of Server Side Flow in .NET (http://bit.ly/POn6ZZ)

My Blog (http://bit.ly/Ovv2hI)

All bundled links (http://bitly.com/bundles/o_6pdhih13v3/2)

Page 30: O365con14 - a developer jam with yammer

FAQ

Questions?