{"id":4360,"date":"2020-04-07T13:23:37","date_gmt":"2020-04-07T21:23:37","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=4360"},"modified":"2020-04-07T13:23:37","modified_gmt":"2020-04-07T21:23:37","slug":"outlook-api-public-preview-announcement-april-2020","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/outlook-api-public-preview-announcement-april-2020\/","title":{"rendered":"Outlook API Public Preview Announcement &#8211; April 2020"},"content":{"rendered":"<h2>What\u2019s included in the preview?<\/h2>\n<p>APIs in the following functional areas are included (please see more details below).<\/p>\n<ol>\n<li><strong>Signature APIs<\/strong> \u2013 A set of APIs that enables developers to implement admin-driven, cloud-enabled custom signatures on e-mails.<\/li>\n<li><strong>Append on send<\/strong> \u2013 APIs that enable adding content on emails and calendar items after users press \u201cSend\u201d (for example, disclaimers or signatures).<\/li>\n<li><strong>Additional calendar properties<\/strong> \u2013 Access to additional properties that reduce the need to call EWS, REST, or Graph calls.<\/li>\n<\/ol>\n<h2>How to use the preview APIs?<\/h2>\n<p>The preview is now available in Outlook on the web and Windows. In order to try the new APIs, you will need to:<\/p>\n<ol>\n<li>Install the latest Office (for Windows) <a href=\"https:\/\/insider.office.com\/join\">Insiders Fast<\/a> (builds 16.12718.20010+).<\/li>\n<li>Use the preview CDN for Office.js at: <a href=\"https:\/\/appsforoffice.microsoft.com\/lib\/beta\/hosted\/office.js\">https:\/\/appsforoffice.microsoft.com\/lib\/beta\/hosted\/office.js<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/admin\/manage\/release-options-in-office-365?view=o365-worldwide&amp;branch=master#set-up-the-release-option-in-the-admin-center\">Configure targeted release on your Microsoft 365 tenant<\/a> for access to the preview bits in Outlook on the web.<\/li>\n<\/ol>\n<h2>Signature API<\/h2>\n<p>This is a very popular request for our team to enable cloud-based signature management and tries to deal with the following gaps.<\/p>\n<ul>\n<li>Enable signature across Outlook clients (Windows\/OWA\/Mac\/Mobile).<\/li>\n<li>Enable enterprise-themed admin-controlled signatures where:\n<ul>\n<li>Enterprise themes are enabled, including images, logos, etc.<\/li>\n<li>Many signature solutions in the market stamp them in the server, meaning end users can\u2019t visualize the signature before the e-mail is sent. This feature can enable the insertion of signatures during compose. (In the near future, we will enable a complementary feature to add the signature upon composing a new email.)<\/li>\n<li>Insert signature directly under a new email.<\/li>\n<li>Override the native behavior to enable a consistent look and feel.<\/li>\n<\/ul>\n<\/li>\n<li>Enable enterprise customization and design options for the signatures.<\/li>\n<\/ul>\n<p>In order to enable the above, we are exposing the following APIs.<\/p>\n<p>1. <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/outlook\/office.messagecompose?view=outlook-js-preview#getcomposetypeasync-options--callback-\"><code>getComposeTypeAsync<\/code><\/a>:\u202fAllows\u202fchecking\u202fthe type of email compose \u2013 new mail, reply, or forward.\u202f\u202fThis will provide developers with the ability to deliver a distinct signature for each case.<\/p>\n<pre class=\"\">function\u202fgetComposeType()\u202f{\n  \/\/\u202fGet\u202fthe\u202fcompose\u202ftype\u202fof\u202fthe\u202fcurrent\u202fitem\u202f(mail\u202fonly).\n  Office.context.mailbox.item.getComposeTypeAsync(function(asyncResult)\u202f{\n    if\u202f(asyncResult.status\u202f===\u202fOffice.AsyncResultStatus.Succeeded)\u202f{\n      console.log(\n        \"getComposeTypeAsync\u202fsucceeded\u202fwith\u202fcomposeType:\u202f\"\u202f+\n        asyncResult.value.composeType\u202f+\n        \"\u202fand\u202fcoercionType:\u202f\"\u202f+\n        asyncResult.value.coercionType\n      );\n    }\u202felse\u202f{\n      console.error(asyncResult.error);\n    }\n  });\n}<\/pre>\n<p>2. <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/outlook\/office.messagecompose?view=outlook-js-preview#isclientsignatureenabledasync-options--callback-\"><code>isClientSignatureEnabledAsync<\/code><\/a>:\u202fChecks whether the native Outlook signature is enabled.\u202f\u202f This allows developers to verify if the user is currently using a native signature.<\/p>\n<pre class=\"\">function\u202fisClientSignatureEnabled()\u202f{\n  \/\/\u202fCheck\u202fif\u202fthe\u202fclient\u202fsignature\u202fis\u202fcurrently\u202fenabled.\n  Office.context.mailbox.item.isClientSignatureEnabledAsync(function(asyncResult)\u202f{\n    if\u202f(asyncResult.status\u202f===\u202fOffice.AsyncResultStatus.Succeeded)\u202f{\n      console.log(\"isClientSignatureEnabledAsync\u202fsucceeded\u202fwith\u202fresult:\u202f\"\u202f+\u202fasyncResult.value);\n    }\u202felse\u202f{\n      console.error(asyncResult.error);\n    }\n  });\n}<\/pre>\n<p>3. <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/outlook\/office.messagecompose?view=outlook-js-preview#disableclientsignatureasync-options--callback-\"><code>disableClientSignatureAsync<\/code><\/a>:\u202fDisables\u202fthe native Outlook signature. This API enables developers to override the native signature behavior.<\/p>\n<pre class=\"\">function\u202fdisableClientSignature()\u202f{\n  \/\/\u202fDisable\u202fthe\u202fclient\u202fsignature.\n  Office.context.mailbox.item.disableClientSignatureAsync(function(asyncResult)\u202f{\n    if\u202f(asyncResult.status\u202f===\u202fOffice.AsyncResultStatus.Succeeded)\u202f{\n      console.log(\"disableClientSignatureAsync\u202fsucceeded\");\n    }\u202felse\u202f{\n      console.error(asyncResult.error);\n    }\n  });\n}<\/pre>\n<p>4. <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/outlook\/office.body?view=outlook-js-preview#setsignatureasync-data--options--callback-\"><code>setSignatureAsync<\/code><\/a>:\u202fReplaces the native outlook signature and stamps the add-in defined signature.<\/p>\n<p><strong>Note<\/strong>: You can use:<\/p>\n<ul>\n<li>The optional object to change the insertion formatting to HTML.<\/li>\n<li>Maximum 30,000 characters.<\/li>\n<\/ul>\n<pre class=\"\">function\u202fsetSignature()\u202f{\n  \/\/\u202fSet\u202fthe\u202fsignature\u202ffor\u202fthe\u202fcurrent\u202fitem.\n  var\u202fsignature\u202f=\u202f\u201cThis is my signature\u201d;\n  console.log(`Setting\u202fsignature\u202fto\u202f\"${signature}\".`);\n  Office.context.mailbox.item.body.setSignatureAsync(signature,{coercionType:\"html\"},\u202ffunction(asyncResult)\u202f{\n    if\u202f(asyncResult.status\u202f===\u202fOffice.AsyncResultStatus.Succeeded)\u202f{\n      console.log(\"setSignatureAsync\u202fsucceeded\");\n    }\u202felse\u202f{\n      console.error(asyncResult.error);\n    }\n  });\n}<\/pre>\n<h2>Append on send<\/h2>\n<p>Appends on send the specified content to the end of the message or appointment body, after any signature.<\/p>\n<p>If the user is running add-ins that implement the on-send feature using <code>ItemSend<\/code> in the manifest, append on send runs before on-send functionality.<\/p>\n<p><strong>Important<\/strong>: To use <a href=\"https:\/\/docs.microsoft.com\/javascript\/api\/outlook\/office.body?view=outlook-js-preview#appendonsendasync-data--options--callback-\"><code>appendOnSendAsync<\/code><\/a>, the <code>AppendOnSend<\/code> extended permission must be included in the <a href=\"https:\/\/docs.microsoft.com\/office\/dev\/add-ins\/reference\/manifest\/extendedpermissions\"><code>ExtendedPermissions<\/code><\/a> node of the manifest.<\/p>\n<p><strong>Note<\/strong>: To clear data from a previous <code>appendOnSendAsync<\/code> call, you can call it again with the data parameter set to null.<\/p>\n<pre class=\"\">function\u202fappendOnSend()\u202f{\n  Office.context.mailbox.item.body.appendOnSendAsync(\n    \"Disclaimer:\u202fThis\u202fis\u202fAppend\u202fOn\u202fSend\",\n    function(result)\u202f{\n      console.log(result);\n    });\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post announces a couple of Outlook add-ins API features that were introduced in preview as of April 2020.<\/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":[11],"tags":[12],"class_list":["post-4360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-outlook"],"acf":[],"blog_post_summary":"<p>This post announces a couple of Outlook add-ins API features that were introduced in preview as of April 2020.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4360","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=4360"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4360\/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=4360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=4360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=4360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}