Object URI Messages .

Post on 14-Dec-2015

243 views 12 download

Tags:

Transcript of Object URI Messages .

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

SPC371

Kiwi on loan to the USA – Seattle

www.looselytyped.net

@LoungeFlyZ

Ex-10yr Microsoftie, SharePoint Product Management,

Program Management and Consulting Services

whoami?

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

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

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

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

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

REST API OverviewProtocols and FormatsHTTPS requestsJSON responses

HTTP VerbsGET, POST, DELETE

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

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,

...

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

REST CoverageObjectsMessagesGroupsUsersNotificationsSuggestionsAutocompleteInvitationsSearchNetworks

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

Demo

REST APIs

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

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

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]

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]

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>

Demo

Authenticating with Yammer OAuth 2

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

OG File Location

Conversations, Likes, etc…

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

{ "activity": { "actor": {"name": "Chris Johnson", "email": “chris@looselytyped.net"}, "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" }}

Custom OG Objects

Demo

Creating Open Graph Objects

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.

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

Demo

Embed and Liking things

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

Share It for Office

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

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

Q&A

MySPCSponsored by

connect. reimagine. transform.

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

© 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.