{"id":221,"date":"2017-10-26T00:00:00","date_gmt":"2017-10-26T00:00:00","guid":{"rendered":"http:\/\/officedevblogs.wpengine.com\/?p=221"},"modified":"2017-10-26T00:00:00","modified_gmt":"2017-10-26T00:00:00","slug":"migrating-from-outlook-rest-api-v1-0-to-microsoft-graph","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/migrating-from-outlook-rest-api-v1-0-to-microsoft-graph\/","title":{"rendered":"Migrating from Outlook REST API v1.0 to Microsoft Graph"},"content":{"rendered":"<div id=\"body-content\">\n<p>Version 1.0 of the<a href=\"https:\/\/msdn.microsoft.com\/en-us\/office\/office365\/api\/mail-rest-operations\"> Outlook REST API <\/a>was launched in 2015 to provide API access to mail, calendar, contacts, and other data from Exchange Online, with support for Basic Authentication.\u00a0 Over time, we\u2019ve released major enhancements in Outlook REST API v2.0 and Microsoft Graph, both of which provide richer features, and better performance and reliability than Outlook REST API v1.0. Both Outlook REST API v2.0 and <a href=\"https:\/\/developer.microsoft.com\/graph\">Microsoft Graph <\/a>use OAuth 2.0 for authentication and authorization, which is a more secure and reliable way than Basic Authentication to access data.<\/p>\n<p>With the planned deprecation of the Outlook REST API v1.0, you can update your app to Microsoft Graph and leverage all the new functionality available there.\u00a0 This article will give you guidance on the process of upgrading from the Outlook v1.0 REST API to the <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\">Microsoft Graph <\/a>REST API and well as pointing some of the key differences.<\/p>\n<p>Major Differences between Outlook v1.0 and Microsoft Graph:<\/p>\n<ol>\n<li><strong>Authorization protocol<\/strong> &#8211; Microsoft Graph uses the newer and more secure OAuth 2.0 and OpenID Connect authorization protocols. If you are already using OAuth 2.0 in your app, then you can skip this section. If you are using Basic Authentication to connect to v1.0 of the Outlook REST endpoint, upgrade to use OAuth 2.0 and OpenID Connect by getting access tokens from <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/docs\/concepts\/auth_overview\">Azure Active Directory<\/a>.<\/li>\n<li><strong>Supported account types and app types &#8211; <\/strong>If you are using Basic Authorization with the Outlook v1.0 REST endpoint, changing to use OAuth 2.0 and OpenID Connect opens up your app to a much larger user base, by allowing you to access users with work or school accounts, as well as users with Microsoft personal accounts. You can also choose to enable user-specific experiences like Single Sign-on (SSO) and support <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/docs\/concepts\/auth_overview#what-kind-of-apps-can-i-call-microsoft-graph-from\">different app types<\/a> such as Single Page Apps (SPA) and background services like daemon apps. Find out more about the <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/docs\/concepts\/permissions_reference\">different types of permissions<\/a> for which you can get access tokens to suit your purpose.<\/li>\n<li><strong>API endpoint<\/strong> &#8211; The next major difference is that Microsoft Graph endpoint is <a href=\"https:\/\/graph.microsoft.com\">https:\/\/graph.microsoft.com<\/a>. Change your code to access your REST API calls here. All Outlook v1.0 capabilities are available in Microsoft Graph, and new features are always made available in the Microsoft Graph endpoint. You can quickly try out and compare the APIs on the 2 endpoints: use the <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/graph-explorer\">Graph Explorer tool<\/a> for the Microsoft Graph APIs , and the <a href=\"https:\/\/oauthplay.azurewebsites.net\/\">Outlook API Explorer<\/a> for the Outlook REST API.<\/li>\n<\/ol>\n<h3>Detailed Schematic Differences between Microsoft Graph v1.0 and Outlook v1.0<\/h3>\n<p><strong>Casing<\/strong><\/p>\n<p>Microsoft Graph uses the standard lower camel case as the convention for casing while the Outlook REST API uses PascalCase.<\/p>\n<p><strong>MeetingRequest<\/strong><\/p>\n<p>Meeting requests messages are returned in the generic Message type in v1 while in Microsoft Graph they are under a separate derived type called \u201cmeetingRequest\u201d.<\/p>\n<p><strong>Item<\/strong><\/p>\n<p>The Item entity in Outlook API has been renamed to outlookItem.<\/p>\n<p><strong>Folder<\/strong><\/p>\n<p>The Outlook Folder entity in the schema has been renamed to mailFolder in the Microsoft Graph API.<\/p>\n<ul>\n<li>Renamed Folder as -mailFolder<\/li>\n<li>Removed the navigation property RootFolder<\/li>\n<\/ul>\n<p><strong>Attachment<\/strong><\/p>\n<p>The following date properties have been renamed:<\/p>\n<ul>\n<li>From DateTimeLastModified to lastModifiedDateTime<\/li>\n<li>From DateTimeCreated to createdDateTime<\/li>\n<li>From dateTimeLastModified to lastModifiedDateTime<\/li>\n<\/ul>\n<p><strong>Message<\/strong><\/p>\n<p>The following date properties have been renamed:<\/p>\n<ul>\n<li>From DateTimeReceived to receivedDateTime<\/li>\n<li>From dateTimeSent to sentDateTime<\/li>\n<\/ul>\n<p><strong>FileAttachment<\/strong><\/p>\n<ul>\n<li>Removed the property IsContactPhoto<\/li>\n<\/ul>\n<p><strong>Event<\/strong><\/p>\n<p>The following date properties have been renamed:<\/p>\n<ul>\n<li>From StartTimeZone to originalStartTimeZone<\/li>\n<li>From EndTimeZone to originalEndTimeZone<\/li>\n<li>From Reminder to reminderMinutesBeforeStart<\/li>\n<li>Changed the type of Start and End from Edm.DateTimeOffset to microsoft.graph.dateTimeTimeZone<\/li>\n<\/ul>\n<p><strong>RecurrenceRange<\/strong><\/p>\n<ul>\n<li>Changed the type of StartDate and EndDate from Edm.DateTimeOffset to microsoft.graph.dateTimeTimeZone<\/li>\n<\/ul>\n<h3>Next Steps<\/h3>\n<p>As a starting point, go to the <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/docs\/concepts\/overview\">Microsoft Graph documentation<\/a> where you can find detailed information about the platform. Microsoft Graph also supports a variety of <a href=\"https:\/\/developer.microsoft.com\/en-us\/graph\/code-samples-and-sdks\">client libraries\/SDKs<\/a>. If you have any questions or concerns as you are working through this migration, please reach out on <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/microsoft-graph\">Stackoverflow<\/a>; the Microsoft Graph team actively monitors that site.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Version 1.0 of the Outlook REST API was launched in 2015 to provide API access to mail, calendar, contacts, and other data from Exchange Online, with support for Basic Authentication.\u00a0 Over time, we\u2019ve released major enhancements in Outlook REST API v2.0 and Microsoft Graph, both of which provide richer features, and better performance and reliability than Outlook REST API v1.0.<\/p>\n","protected":false},"author":69077,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[12],"class_list":["post-221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-outlook"],"acf":[],"blog_post_summary":"<p>Version 1.0 of the Outlook REST API was launched in 2015 to provide API access to mail, calendar, contacts, and other data from Exchange Online, with support for Basic Authentication.\u00a0 Over time, we\u2019ve released major enhancements in Outlook REST API v2.0 and Microsoft Graph, both of which provide richer features, and better performance and reliability than Outlook REST API v1.0.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69077"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}