{"id":956,"date":"2016-03-21T00:00:00","date_gmt":"2016-03-21T07:00:00","guid":{"rendered":"http:\/\/officedevblogs.wpengine.com\/?p=956"},"modified":"2016-03-21T00:00:00","modified_gmt":"2016-03-21T07:00:00","slug":"microsoft-graph-webhooks-update-march-2016","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-webhooks-update-march-2016\/","title":{"rendered":"Microsoft Graph webhooks update &#8211; March 2016"},"content":{"rendered":"<div id=\"body-content\">\n<div>\n<p>Hi folks, we&#8217;ve got another incremental update for our <a href=\"https:\/\/developer.microsoft.com\/graph\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Graph<\/a> webhooks preview on the journey towards shipping a production release.&nbsp; First, I&#8217;m pleased to say we&#8217;ve rounded out the set of available operations with support for DELETE and PATCH, as well as POST and GET.<\/p>\n<p>Now, you can delete an existing subscription with the following http code:<\/p>\n<p>  <br>  <\/p>\n<pre><code>  DELETE https:\/\/graph.microsoft.com\/beta\/subscriptions\/{id}  Authorization: Bearer &lt;YourOAuthToken&gt;  <br>  <\/code><\/pre>\n<p>  <br>  <\/p>\n<p>And you can extend the expiration time on a subscription with the following simple patch command:<\/p>\n<p>  <br>  <\/p>\n<pre><code>  PATCH https:\/\/graph.microsoft.com\/beta\/subscriptions\/{id}  Authorization: Bearer &lt;YourOAuthToken&gt;  Content-type: application\/json  {    \"expirationDateTime\" : \"2016-03-16T18:23:45.9356913Z\"  }  <\/code><\/pre>\n<p>Subscriptions to Outlook data will have a maximum expirationDateTime of 4230 minutes from the time of subscription creation. It&#8217;s a good idea to use this new PATCH functionality to extend your subscription well before it times out.<\/p>\n<p>We&#8217;ve also made a couple of changes to the property names for working with subscriptions, so we&#8217;re more consistent across Microsoft APIs, and we&#8217;ve added a requirement to set the expirationDateTime explicitly when you create a subscription. Here&#8217;s the new code:<\/p>\n<p>  <br>  <\/p>\n<pre><code>  POST https:\/\/graph.microsoft.com\/beta\/subscriptions  Content-type: application\/json  Authorization: Bearer &lt;YourOAuthToken&gt;  {    \"changeType\": \"created\",    \"notificationUrl\": \"<a href=\"\/\/%3cYourAppURLHere%3e\/api\/webhookCallback\">[https:\/\/&lt;YourAppURLHere&gt;\/api\/webhookCallback%3c\/a%3e&amp;quot]https:\/\/&lt;YourAppURLHere&gt;\/api\/webhookCallback<\/a>\",    \"resource\": \"me\/messages\",    \"expirationDateTime\" : \"2016-03-16T18:23:45.9356913Z\"  }  <\/code><\/pre>\n<p>  <br>  <\/p>\n<p>If the request succeeds, the response will be:<\/p>\n<p>  <br>  <\/p>\n<pre><code>  HTTP\/1.1 201 Created  {    \"@odata.context\":\"https:\/\/graph.microsoft.com\/beta\/$metadata#subscriptions\/$entity\",    \"id\":\"7f105c7d-2dc5-4530-57cd-4e7af6534c03\",    \"resource\":\"me\/messages\",    \"changeType\":\"created\",    \"notificationUrl\":\"https:\/\/&lt;YourAppURLHere&gt;\/api\/webhookCallback\",    \"expirationDateTime\":\"2016-03-16T18:23:45.9356913Z\"  }  <\/code><\/pre>\n<p>  <br>  <\/p>\n<p>If your expirationDateTime is beyond the range that the resource you asked for supports, then you&#8217;ll get a 400 error.<\/p>\n<p>The eagle-eyed among you will notice we&#8217;ve changed the &#8216;subscriptionId&#8217; property to be just &#8216;id&#8217;, and the &#8216;subscriptionExpirationDateTime&#8217; to be just &#8216;expirationDateTime&#8217;.<\/p>\n<p>We expect these changes to be the final ones to the API shape now before we go to production.<\/p>\n<p>Enjoy the new APIS, and as always, reach out to us on Twitter with the #MicrosoftGraph hashtag with your feedback.<\/p>\n<p>Gareth and the webhooks team.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hi folks, we&#8217;ve got another incremental update for our Microsoft Graph webhooks preview on the journey towards shipping a production release.&nbsp; First, I&#8217;m pleased to say we&#8217;ve rounded out the set of available operations with support for DELETE and PATCH, as well as POST and GET. Now, you can delete an existing subscription with the [&hellip;]<\/p>\n","protected":false},"author":69076,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,128,11],"tags":[18,35,12],"class_list":["post-956","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","category-microsoft-teams","category-office-add-ins","tag-excel","tag-onedrive","tag-outlook"],"acf":[],"blog_post_summary":"<p>Hi folks, we&#8217;ve got another incremental update for our Microsoft Graph webhooks preview on the journey towards shipping a production release.&nbsp; First, I&#8217;m pleased to say we&#8217;ve rounded out the set of available operations with support for DELETE and PATCH, as well as POST and GET. Now, you can delete an existing subscription with the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/956","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\/69076"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/956\/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=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}