Object URI Messages .

45

Transcript of Object URI Messages .

Page 1: Object URI Messages  .
Page 2: Object URI Messages  .

Developing socially connected apps with Yammer, SharePoint and OpenGraphChris JohnsonGeneral ManagerProvoke Solutions

SPC371

Page 3: Object URI Messages  .

Kiwi on loan to the USA – Seattle

www.looselytyped.net

@LoungeFlyZ

Ex-10yr Microsoftie, SharePoint Product Management,

Program Management and Consulting Services

whoami?

Page 4: Object URI Messages  .

What we are going to cover todayUnderstand Yammer APIsAPI options and choicesAuthentication

What is OpenGraph in YammerObjects and APIsHow to use OpenGraph in Yammer

API SecretsHidden gems and how to find them

Examples and DemosSeeing it all in action

Page 5: Object URI Messages  .

Why use Yammer APIsSocially Connected applicationsSurface rich social interactions for people in your appsFriction free collaborationSharing content Commenting on thingsLiking things

Page 6: Object URI Messages  .

Business ValueIntegrated social capabilities extend the reach of your organizations information and therefore knowledge, IP and advantage

Page 7: Object URI Messages  .
Page 8: Object URI Messages  .
Page 9: Object URI Messages  .

You can build deep integration with Yammer in your own applications.

Page 10: Object URI Messages  .

Yammer API overview capabilitiesAPIs• REST• JavaScript• OpenGraph• Embed widget• SDKs – Ruby, Python, iOS, Windows Phone

Where?• Web applications• .Net applications• Mobile applications• Back end services and Line of Business applications

Page 11: Object URI Messages  .

REST API OverviewProtocols and FormatsHTTPS requestsJSON responses

HTTP VerbsGET, POST, DELETE

Example: GET https://www.yammer.com/api/v1/messages.json

Page 12: Object URI Messages  .

Message payload{

"id": 361548022,"sender_id": 1499582735,"replied_to_id": null,"created_at": "2014/01/30 01:14:17 +0000","network_id": 863840,"message_type": "update","sender_type": "user","url": "https://www.yammer.com/api/v1/messages/361548022","web_url": "https://www.yammer.com/yammerisawesome.onmicrosoft.com/messages/361548022","body": {

"parsed": "Great sales numbers! This is great!","plain": "Great sales numbers! This is great!","rich": "Great sales numbers! This is great!"

},"thread_id": 361548022,"client_type": "Web","client_url": "https://www.yammer.com/","system_message": false,"direct_message": false,

...

Page 13: Object URI Messages  .

REST OverviewTables are easy to modify

Object URIMessages https://www.yammer.com/api/v1/messages.json

https://www.yammer.com/api/v1/messages/my_feed.jsonhttps://www.yammer.com/api/v1/messages/following.jsonhttps://www.yammer.com/api/v1/messages/private.json

Groups https://www.yammer.com/api/v1/group_memberships.json?group_id=[:id]

Users https://www.yammer.com/api/v1/users.jsonhttps://www.yammer.com/api/v1/users/current.json

Notifications https://www.yammer.com/api/v1/streams/notifications.json

Search https://www.yammer.com/api/v1/search.json

Page 14: Object URI Messages  .

REST CoverageObjectsMessagesGroupsUsersNotificationsSuggestionsAutocompleteInvitationsSearchNetworks

http://developer.yammer.com/restapi/

Page 15: Object URI Messages  .

Demo

REST APIs

Page 16: Object URI Messages  .

AuthenticationOAuth 21. User Authentication – User logs in2. App Authorization – App asks the user for to be trusted3. App Authentication – App asks access

App IdentityApp IDApp Secret

Page 17: Object URI Messages  .

Setting up an Apphttps://www.yammer.com/client_applications

Page 18: Object URI Messages  .

AuthenticationServer Side Authentication FlowRedirect user to:

https://www.yammer.com/dialog/oauth?client_id=[:client_id]&redirect_uri=[:redirect_uri]

Redirected back to:

http://[:redirect_uri]?code=[:code]

App requests a token:

https://www.yammer.com/oauth2/access_token.json?client_id=[:client_id]&client_secret=[:client_secret]&code=[:code]

Page 19: Object URI Messages  .

AuthenticationClient Side FlowRedirect user to:

https://www.yammer.com/dialog/oauth?client_id=[:client_id]&redirect_uri=[:redirect_uri]&response_type=token

Browser directed to and passed a token:

http://[:redirect_uri]#access_token=[:access_token]

Page 20: Object URI Messages  .
Page 21: Object URI Messages  .
Page 22: Object URI Messages  .

Yammer JavaScript SDKAuthenticationWraps authentication for youLogin with Yammer button

Requests/ActionsHelpers for requests to Yammer

<script type="text/javascript" data-app-id=“<APP CLIENTID>“ src="https://assets.yammer.com/platform/yam.js"></script>

Page 23: Object URI Messages  .

Demo

Authenticating with Yammer OAuth 2

Page 24: Object URI Messages  .

OpenGraphActivity basedCreate, update, delete, follow, like

Person + Action + Thing on AppName + Messagee.g. Chris liked SalesDocument on ShareIT : Great doc!

OG ObjectFile, Page, Person, Department, Project, Document, Image, Audio, Video, Company

Endpoint:https://www.yammer.com/api/v1/activity.json

https://www.yammer.com/contoso.com/graph/350847273805826 <= Open Graph ID

Page 25: Object URI Messages  .

OG File Location

Conversations, Likes, etc…

Page 26: Object URI Messages  .

Creating Open Graph ObjectsPOST to https://www.yammer.com/api/v1/activity.json

{ "activity": { "actor": {"name": "Chris Johnson", "email": “[email protected]"}, "action": "contosodeveloper:commit", "object": { "url": “mytfsserver/tfs/DefaultCollection/Contoso/_versionControl/changeset/73658", "type":"contosodeveloper:changeset", "image":"https://mytfsserver/images/commit.png", "description":“Changeset #73658 was committed by Chris. Flame away!", "title":"Changeset #73658 was committed" }, "private": "false", "message": “committing" }}

Page 27: Object URI Messages  .

Custom OG Objects

Page 28: Object URI Messages  .
Page 29: Object URI Messages  .

Demo

Creating Open Graph Objects

Page 30: Object URI Messages  .

Building on Open Graph objectsWhat can you do?Likes and Conversations about arbitrary things e.g. Line of Business Data transactions/entities

Use Yammer as your social storeUse Yammer as the engine/storeBuild on the foundation it already provides

EngageEmbed the conversation in your app and the ability to interact.

Page 31: Object URI Messages  .
Page 32: Object URI Messages  .

Embed Widget Configurationhttps://www.yammer.com/widget/configure

Page 33: Object URI Messages  .

Demo

Embed and Liking things

Page 34: Object URI Messages  .

Extra APIsCaution!!OpenGraph Objectshttps://www.yammer.com/api/v1/messages/open_graph_objects/356127817571330.json

Fileshttps://www.yammer.com/api/v1/uploaded_files/in_group/2781204.json

Messages about a file:https://www.yammer.com/api/v1/messages/about_file/16542566.json

Finding APIs - Example

Page 35: Object URI Messages  .

Share It for Office

Page 36: Object URI Messages  .
Page 37: Object URI Messages  .
Page 38: Object URI Messages  .
Page 39: Object URI Messages  .
Page 40: Object URI Messages  .
Page 41: Object URI Messages  .
Page 42: Object URI Messages  .

SummarySocially connect your appsDon’t rebuild the wheelAPIs of all sizes, shapes and languages to suit

More OpenGraph information :http://developer.yammer.com/opengraph/

Page 43: Object URI Messages  .

Q&A

Page 44: Object URI Messages  .

MySPCSponsored by

connect. reimagine. transform.

Evaluate sessionson MySPC using yourlaptop or mobile device:myspc.sharepointconference.com

Page 45: Object URI Messages  .

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.