{"id":6490,"date":"2021-06-24T08:51:08","date_gmt":"2021-06-24T16:51:08","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=6490"},"modified":"2021-06-24T08:51:08","modified_gmt":"2021-06-24T16:51:08","slug":"attention-breaking-changes-coming-to-the-microsoft-graph-userpurpose-api-beta","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/attention-breaking-changes-coming-to-the-microsoft-graph-userpurpose-api-beta\/","title":{"rendered":"Attention: breaking changes\u00a0coming\u00a0to the Microsoft Graph\u00a0userPurpose\u00a0API (beta)\u00a0"},"content":{"rendered":"<p><span data-contrast=\"none\">We\u2019re announcing some upcoming breaking changes\u00a0to\u00a0the Microsoft Graph\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/api\/resources\/userpurpose?view=graph-rest-beta\"><span data-contrast=\"none\">userPurpose<\/span><\/a><span data-contrast=\"none\"> API (beta). This API enables developers to differentiate the purpose of a mailbox in Exchange Online. For example, a mailbox may belong to a single user, multiple users, a conference room or even a piece of equipment.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">We are planning to take the\u00a0userPurpose\u00a0API offline for some pre-production updates. During\u00a0this time,\u00a0calls to the API will fail.\u00a0We\u00a0are aware of\u00a0several\u00a0apps taking a\u00a0dependency\u00a0on this\u00a0beta\u00a0API. To mitigate the impact of this downtime, we\u00a0are making\u00a0another\u00a0<\/span><b><span data-contrast=\"none\">*temporary*<\/span><\/b><span data-contrast=\"none\">\u00a0API called\u00a0<\/span><i><span data-contrast=\"none\">userPurposeV2<\/span><\/i><span data-contrast=\"none\"> available to minimize disruption to these apps. We anticipate that our updates will take up to twelve weeks and we will provide the community with an update when we\u2019ve established a firm work completion date. After we have deployed our planned updates, developers must switch back <\/span><span data-contrast=\"none\">to the\u00a0userPurpose\u00a0API.\u00a0We will t<\/span><span data-contrast=\"none\">he<\/span><span data-contrast=\"none\">n\u00a0deprecate\u00a0the<\/span><span data-contrast=\"none\">\u00a0<\/span><b><span data-contrast=\"none\">*temporary*\u00a0<\/span><\/b><span data-contrast=\"none\">userPurposeV2 API<\/span><span data-contrast=\"none\">\u00a0in 60 days\u2019\u00a0time.<\/span><\/p>\n<p><span data-contrast=\"none\">\u202f<\/span><span data-contrast=\"none\">These changes will be rolling out to the Microsoft Graph beta endpoint on\u00a0<\/span>August 24, 2021.<span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">\u202f<\/span><span data-contrast=\"none\">We would like to again remind our developers that we do not encourage usage of beta APIs in production applications as they are subject to such breaking changes.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<h4><span data-contrast=\"none\">\u202f<\/span><b><span data-contrast=\"none\">What is the change?<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"none\">The beta userPurpose API is scheduled to undergo fixes which must happen offline. During the maintenance interval all calls to the API will fail with the following error. <\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">Bad Request -\u202f400<\/span><span data-ccp-props=\"{&quot;201341983&quot;:1,&quot;335559739&quot;:160,&quot;335559740&quot;:285}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \">{\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\"error\": {\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"code\":\u00a0\"BadRequest\",\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"message\":\u00a0\"Resource not found for the segment 'userPurpose'.\",\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"innerError\": {\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"date\":\u00a0\"\u2026\",\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"request-id\":\u00a0\"\u2026\",\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"client-request-id\":\u00a0\"\u2026\"\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\u00a0\n\n\u00a0\u00a0\u00a0\u00a0}\u00a0\n\n}<\/pre>\n<p><span data-contrast=\"none\">Apart from internal fixes, the permission model needed\u00a0to access the API\u00a0will\u00a0undergo some changes\u00a0going forward.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"none\">What do I need to do?<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">If you are dependent on the functionality provided by this API, please update your code to call the\u00a0<\/span><b><span data-contrast=\"none\">*temporary*<\/span><\/b><span data-contrast=\"none\">\u00a0userPurposeV2 API instead (GET\u00a0<\/span><a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2FmailboxSettings%2FuserPurposeV2&amp;data=04%7C01%7CAbheek.Das%40microsoft.com%7C1b06fa3bfd3448f095f908d931a3d092%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637595401929654565%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PgUDyJv2gcKXIQh6pvUIB1%2Bn0mADUs%2Bd7IQGp8sncbc%3D&amp;reserved=0\"><span data-contrast=\"none\">https:\/\/graph.microsoft.com\/beta\/me\/mailboxSettings\/userPurposeV2<\/span><\/a><span data-contrast=\"none\">). The\u00a0temporary API\u00a0will provide the same response as the current\u00a0userPurpose\u00a0API.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">You can use the following code-snippet to catch the exception:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \">try\u00a0\n\n{\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Uri\u00a0Uri\u00a0= new Uri(\"https:\/\/graph.microsoft.com\/beta\/users\/&lt;Id&gt;\/mailboxSettings\/UserPurpose\");\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0httpResult\u00a0=\u00a0httpClient.GetStringAsync(Uri).Result;\u00a0\n\n}\u00a0\n\ncatch (AggregateException\u00a0e)\u00a0\n\n{\u00a0\n\n\u00a0\u00a0\u00a0\u00a0System.Net.Http.HttpRequestException\u00a0innerException\u00a0=\u00a0e.InnerException\u00a0as\u00a0System.Net.Http.HttpRequestException;\u00a0\n\n\u00a0\u00a0\u00a0 if (innerException?.StatusCode\u00a0==\u00a0System.Net.HttpStatusCode.BadRequest)\u00a0\n\n\u00a0\u00a0\u00a0 {\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Uri\u00a0Uri\u00a0= new Uri(\"https:\/\/graph.microsoft.com\/beta\/users\/&lt;Id&gt;\/mailboxSettings\/UserPurposeV2\");\u00a0\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0httpResult\u00a0=\u00a0httpClient.GetStringAsync(Uri).Result;\u00a0\n\n\u00a0\u00a0\u00a0 }\u00a0\n\n}<\/pre>\n<p><span data-contrast=\"none\">Once the original\u00a0userPurpose\u00a0API is fixed and back up, you\u00a0<\/span><span data-contrast=\"none\">will<\/span><span data-contrast=\"none\">\u00a0need to switch back to the original API.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">Testing new features for your\u00a0apps\u00a0using\u00a0beta APIs like this one on the\u00a0Microsoft Graph\u00a0API? Help us shape\u00a0its future.\u00a0 The\u00a0Microsoft Graph CPx team runs a\u00a0Fellowship of the Graph TAP (Technology Adoption Program). This group is a combination of Microsoft Valuable Professionals (MVPs), Regional Directors (RDs), and Independent Software Vendors (ISVs) actively working with Microsoft Graph. If you want to be part of the TAP and receive notifications around changes like this, please complete the\u00a0<\/span><a href=\"https:\/\/aka.ms\/GraphTAPForm\"><span data-contrast=\"none\">TAP\u00a0submission form<\/span><\/a><span data-contrast=\"none\">\u00a0for consideration.<\/span><\/p>\n<p><span data-contrast=\"none\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0userPurpose\u00a0API will be offline for some pre-production updates. To mitigate the impact of this downtime, we\u00a0are making\u00a0another\u00a0*temporary*\u00a0API called\u00a0userPurposeV2.<\/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":[],"class_list":["post-6490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph"],"acf":[],"blog_post_summary":"<p>The\u00a0userPurpose\u00a0API will be offline for some pre-production updates. To mitigate the impact of this downtime, we\u00a0are making\u00a0another\u00a0*temporary*\u00a0API called\u00a0userPurposeV2.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6490","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=6490"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6490\/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=6490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=6490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=6490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}