Deep Dive into the Office 365 RESTful APIsRob Howard
DEV-B309
Session Objectives And TakeawaysSession Objective(s): Understand why these Office 365 APIs were builtLearn how to get started with Office 365 APIs See the key APIs available in the Office 365 APIs
Enrich device apps and web sites with O365 servicesPlease continue to provide feedback, we’re listening
My Apps
CONNECT TO OFFICE 365 SERVICES
Users and
groups
Files
Mail Calendar
Contacts
BUILD USING AN OPEN PLATFORM
z
EXTEND OFFICE EVERYWHERE
Users and
groups
What’s New
O365 Device Apps
Single auth flow for O365Azure AD Graph, Exchange, SharePointDevice apps and web sitesAdmin and end-user consent
Secure protocolOAuth 2.0No capturing user credentialsFine-grained access scopesSupports MFA and federated user sign-inLong-term access through refresh tokens
Azure AD OAuth in O365 Preview
Authentication to Office 365 APIs using Resource IdNative Application
Azure AD Authorization
Endpoint
Azure AD Token
Endpoint Office 365 API
Request authorization code
Sign-in via browser pop-up
Return authorization code
Redeem authorization code and acquire access token for Office 365 resource
Return access token and refresh token
Return Http Response
Call Office 365 API using the access token
Azure AD OAuth and O365
Demo
O365 Device Apps
Automatically determine URL of O365 servicesSupports device app and web site flowsSecured using Azure AD authenticationServes information stored about services in AAD
O365 Discovery Services Preview
Office 365 Discovery ServicesDemo
Simple REST/OData Service APIsExpose Files, Lists, Mail, Calendar, and People/GroupsAvailable now for SharePoint, Exchange, AADSupports Azure AD OAuthEndpoints found through service discovery
Office 365 API Preview
PermissionsRead, Read+Write
Entities, Collections, Actions
Sampleshttps://<onedrive>/_api/fileshttps://<onedrive>/_api/files('foldername/filename.foo')
Files
Entity Collection Actions
File FileSystemItemCollection CRUD, Upload, Download
Folder FileSystemItemCollection CRUD, Enumerate Children
PermissionsRead, Read+Write
Entities, Collections, Actions
Sampleshttps://outlook.office365.com/EWS/OData/Me/Calendarhttps://outlook.office365.com/EWS/OData/Me/Calendar/Events?$top=1
Calendar
Entity Collection Actions
CalendarGroupCalendarGroups
Calendar Calendars
Event EventsCRUD, Accept, Decline, TentativelyAccept
Attachment Attachments CRUD
PermissionsRead, Read+Write, Send
Entities, Collections, Actions
Sampleshttps://outlook.office365.com/EWS/OData/Me/Inboxhttps://outlook.office365.com/EWS/OData/Me/Inbox/Messages?$top=1
Entity Collection ActionsFolder Folders CRUD, Copy, Move
Message Messages
CRUD, Copy, MoveReply, ReplyAll, Forward, SendCreateReply, CreateReplyAll, CreateForward
Attachment Attachments CRUD
PermissionsRead, Read+Write
Entities, Collections, Actions
Sampleshttps://outlook.office365.com/EWS/OData/Me/ContactFolders('Contacts')/https://outlook.office365.com/EWS/OData/Me/ContactFolders('Contacts')/Contacts
Contacts
Entity Collection Actions
ContactFolderContactFolders
Contact Contacts CRUD
Rich Query Syntax using ODATAScenario URL
Get 5 messages from Inbox Me/Inbox/Messages?$top=5
Get the next 10 messages Me/Inbox/Messages?$top=10&$skip=5
Get top 10 messages sorted by DateTimeCreated
Me/Inbox/Messages?$top=10&$skip=10&$orderby=DateTimeCreated
Get selective properties on messages
Me/Inbox/Messages?$top=5&$select=From,DateTimeCreated,Subject
Get Events starting after a particular DateTime Me/Events?$top=5&$filter=Start ge 2014-03-04T20:00:00Z
Get Contacts where Display Name contains ‘Rohit’ Me/Contacts?$top=10&$filter=contains(DisplayName,‘Rob')
OneDrive for Business Files REST APIGet the metadata for all files in OneDriveGET http://<onedrive>/_api/Files
Get the metadata for a folder in OneDriveGET http://<onedrive>/_api/Files('folder')
Get the metadata for the children of a folder in OneDriveGET http://<onedrive>/_api/Files('folder')/Children
Get the metadata for a single file in OneDriveGET http://<onedrive>/_api/Files('folder/filename.docx')
Download a single file from OneDriveGET http://<onedrive>/_api/Files('folder/filename.docx')/download
OneDrive for Business Files REST APIUpload a file to the specified path in OneDrive (pass file in body)POST /_api/Files/Add(name='folder/filename.docx',overwrite=<bool>)
Delete a file from OneDriveDELETE /_api/Files('folder/filename.docx')
Get metadata for a folder and its childrenGET /_api/Files('folder')?$expand=Children
Get on selected metadata fields back for first 5 files in OneDriveGET /_api/Files?$select=Name,Id,TimeCreated,Size&$top=5
Use Files API on other document librariesGET /_api/Lists/GetByTitle('ListTitle')/Files
http://aka.ms/Office365DevAPIs
O365 APIs Preview
Demo
Custom client code
_api
JavaScript library Silverlight library .Net CLR library
Execute query REST/
OData
…SearchSites, Lists and
LibsTaxonomy BCSWorkflow
The SharePoint client APIs
Office 365 APIsSharePoint
Sites
Exchange & Outlook.com
Calendar
Contacts
Active Directory
Users
Groups
OneDrive
OneDrive for Business
OneDrive
Client API
Search
Sites, Lists and Libs
Taxonomy
BCSWorkflow
…
Available on GitHubSDK for native Android apps that use Office 365 APIsHandles Files, Lists, Mail, and CalendarIntegrates with AD Auth Library
Office 365 SDK for Android
Android SDK for Office 365
Demo
The Android SDK for Office 365 is one of manyWe’ll continue to add SDKs for additional web and device platforms in popularity orderWe’ll develop all SDKs in public open source projectsWe’ll take submissions from the community
Office 365 SDK Roadmap
Get the tools
.NET Windows Store AppsWindows Forms ApplicationWPF ApplicationASP.NET MVC Web ApplicationASP.NET Web Forms ApplicationXamarin Android and iOS ApplicationsMulti-device Hybrid Apps (Cordova)
Visual Studio project support
Office 365 API Tools for VS
Demo
http://aka.ms/o365apis
In Review: Session Objectives And TakeawaysSession Objective(s): Understand why these Office 365 APIs were builtLearn how to get started with Office 365 APIs See the key APIs available in the Office 365 APIs
Enrich device apps and web sites with O365 servicesPlease continue to provide feedback, we’re listening
Building skillsMicrosoft Virtual Academydev.office.com/training
Code Samplesdev.office.com/code-samples
DX Office 365 Dev CampsOffice 365 Summit Developer Trackssummit.office.com
Developer Patterns & Practices
Transform your code
Providing App Model Patterns for common SharePoint Full Trust Code and Office Add-in scenarios
60+ Visual Studio projects
Common scenariosBrandingSite provisioningRemote event receivers
Large file supportTaxonomy driven navigationAnd much more… aka.ms/OfficeDevPnP
RoadmapMonthly updatesAssociated blog postswww.office.com/roadmap
Customer feedback
YammerOffice 365 Technical Network
Stackoverflow
UserVoiceDeveloper focusedBi-weekly triageLink to roadmap to show actions
http://aka.ms/OfficeDevFeedback
Resources
Learning
Microsoft Certification & Training Resources
www.microsoft.com/learning
Developer Network
http://developer.microsoft.com
TechNet
Resources for IT Professionals
http://microsoft.com/technet
Sessions on Demand
http://channel9.msdn.com/Events/TechEd
http://www.visualstudio.com
http://blogs.msdn.com/b/developer-tools/
http://msdn.microsoft.com/vstudio
DEV Track Resources
visualstudio
@visualstudio
visualstudio
Please Complete An Evaluation FormYour input is important!TechEd Schedule Builder CommNet station or PC
TechEd Mobile appPhone or Tablet
QR code
Evaluate this session
© 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.