RESTful APIs Rob Howard DEVB309 Session Objectives And Takeaways Session Objectives Understand why these Office 365 APIs were built Learn how to get started with Office 365 APIs See the key APIs available in the Office 365 APIs ID: 570555
Download Presentation The PPT/PDF document "Deep Dive into the Office 365" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1Slide2
Deep Dive into the Office 365 RESTful APIs
Rob Howard
DEV-B309Slide3
Session Objectives And Takeaways
Session 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 services
Please continue to provide feedback, we’re listeningSlide4
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 NewSlide5
O365 Device AppsSlide6
Single auth flow for O365Azure AD Graph, Exchange, SharePoint
Device apps and web sitesAdmin and end-user consentSecure protocol
OAuth
2.0
No capturing user credentials
Fine-grained access scopesSupports MFA and federated user sign-inLong-term access through refresh tokens
Azure AD
OAuth in O365 PreviewSlide7
Authentication to Office 365 APIs using Resource Id
Native 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 tokenSlide8
Azure AD OAuth and O365
DemoSlide9
O365 Device AppsSlide10
Automatically determine URL of O365 servicesSupports device app and web site flowsSecured using Azure AD authentication
Serves information stored about services in AAD
O365 Discovery Services PreviewSlide11
Office 365 Discovery Services
DemoSlide12
Simple REST/OData Service APIsExpose Files, Lists, Mail, Calendar, and People/GroupsAvailable now for SharePoint, Exchange, AAD
Supports Azure AD OAuthEndpoints found through service discovery
Office 365 API PreviewSlide13
PermissionsRead, Read+Write
Entities, Collections, Actions
Samples
https://<onedrive>/_api/files
https://<onedrive>/_api/files('foldername/filename.foo')
Files
Entity
Collection
Actions
File
FileSystemItemCollection
CRUD, Upload, DownloadFolderFileSystemItemCollection
CRUD, Enumerate
ChildrenSlide14
PermissionsRead, Read+WriteEntities, Collections, Actions
Sampleshttps://outlook.office365.com/EWS/OData/Me/Calendar
https://outlook.office365.com/EWS/OData/Me/Calendar/Events?$top=1
Calendar
Entity
Collection
Actions
CalendarGroup
CalendarGroups
Calendar
Calendars
Event
EventsCRUD, Accept, Decline, TentativelyAccept
AttachmentAttachments
CRUDSlide15
PermissionsRead, Read+Write, Send
Entities, Collections, Actions
Samples
https://outlook.office365.com/EWS/OData/Me/Inbox
https://outlook.office365.com/EWS/OData/Me/Inbox/Messages?$top=1
Mail
Entity
Collection
Actions
Folder
Folders
CRUD, Copy, MoveMessageMessages
CRUD, Copy
, MoveReply, ReplyAll, Forward, SendCreateReply, CreateReplyAll, CreateForward
AttachmentAttachments
CRUDSlide16
PermissionsRead, Read+Write
Entities, Collections, Actions
Samples
https://outlook.office365.com/EWS/OData/Me/ContactFolders('Contacts')/
https://outlook.office365.com/EWS/OData/Me/ContactFolders('Contacts')/Contacts
Contacts
Entity
Collection
Actions
ContactFolder
ContactFolders
ContactContacts
CRUDSlide17
Rich Query Syntax using ODATA
Scenario
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 DateTimeCreatedMe/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 DateTimeMe/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')Slide18
OneDrive for Business Files REST API
Get the metadata for all files in OneDriveGET http://<
onedrive>/_
api/Files
Get the metadata for a folder in OneDrive
GET http://<onedrive>/_api/Files('folder')Get the metadata for the children of a folder in OneDrive
GET http://<onedrive>/_
api/Files('folder')/ChildrenGet 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')/downloadSlide19
OneDrive for Business Files REST API
Upload 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 OneDrive
DELETE /_api/Files('folder/filename.docx
')Get metadata for a folder and its children
GET /_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=5Use Files API on other document librariesGET /_api/Lists/GetByTitle('
ListTitle')/FilesSlide20
http://aka.ms/Office365DevAPIsSlide21
O365 APIs Preview
DemoSlide22
Custom client code
_
api
JavaScript library
Silverlight library
.Net
CLR library
Execute
query
REST/ OData
…
Search
Sites, Lists and Libs
Taxonomy
BCS
Workflow
The SharePoint client APIsSlide23
Office 365
APIs
SharePoint
Sites
Exchange & Outlook.com
Calendar
Contacts
Mail
Active Directory
Users
Groups
OneDrive
OneDrive for Business
OneDrive
Client API
Search
Sites, Lists and Libs
Taxonomy
BCS
Workflow
…Slide24
Available on
GitHubSDK for native Android apps that use Office 365 APIsHandles Files, Lists, Mail, and Calendar
Integrates with AD
Auth
Library
Office 365 SDK for AndroidSlide25
Android SDK for Office 365
DemoSlide26
The Android SDK for Office 365 is one of many
We’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 RoadmapSlide27
Get the toolsSlide28
.NET Windows Store AppsWindows Forms ApplicationWPF ApplicationASP.NET MVC Web Application
ASP.NET Web Forms ApplicationXamarin Android and iOS ApplicationsMulti-device Hybrid Apps (Cordova)
Visual Studio project supportSlide29Slide30
Office 365 API Tools for VS
DemoSlide31
http://aka.ms/o365apis Slide32
In Review: Session Objectives And Takeaways
Session Objective(s): Understand why these Office 365 APIs were built
Learn 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 services
Please continue to provide feedback, we’re listeningSlide33
Building skills
Microsoft Virtual Academy
dev.office.com/training
Code Samples
dev.office.com/code-samples
DX Office 365 Dev CampsOffice 365 Summit
Developer Tracks
summit.office.comSlide34
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 scenarios
Branding
Site provisioning
Remote event receivers
Large file support
Taxonomy driven navigation
And much more…
aka.ms/
OfficeDevPnPSlide35
Roadmap
Monthly updates
Associated blog posts
www.office.com/roadmapSlide36
Customer
feedback
Yammer
Office 365 Technical Network
Stackoverflow
UserVoice
Developer focused
Bi-weekly triage
Link to roadmap to show actions
http://aka.ms/OfficeDevFeedbackSlide37
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/TechEdSlide38
http://www.visualstudio.com
http://blogs.msdn.com/b/developer-tools/
http://msdn.microsoft.com/vstudio
DEV Track Resources
visualstudio
@
visualstudio
visualstudioSlide39
Please Complete An Evaluation FormYour input is important!
TechEd Schedule Builder
CommNet
station
or PC
TechEd Mobile
app
Phone or Tablet
QR codeSlide40
Evaluate this sessionSlide41
© 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.