Created
July 1, 2020 05:41
-
-
Save mukowman/95179dd2dce088403d5a2ed7ed6830f6 to your computer and use it in GitHub Desktop.
Retrieves and displays REST and EWS endpoint URLs and item IDs, and converts item IDs for different protocols.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Endpoint URLs and item IDs | |
description: >- | |
Retrieves and displays REST and EWS endpoint URLs and item IDs, and converts | |
item IDs for different protocols. | |
host: OUTLOOK | |
api_set: {} | |
script: | |
content: | | |
$("#run").click(run); | |
function run() { | |
console.log("EWS URL: " + Office.context.mailbox.ewsUrl); | |
var ewsId = Office.context.mailbox.item.itemId; | |
console.log("EWS item ID: " + Office.context.mailbox.item.itemId); | |
console.log("REST URL: " + Office.context.mailbox.restUrl); | |
var restId = Office.context.mailbox.convertToRestId(ewsId, Office.MailboxEnums.RestVersion.v2_0); | |
console.log("REST item ID: " + restId); | |
var ewsId2 = Office.context.mailbox.convertToEwsId(restId, Office.MailboxEnums.RestVersion.v2_0); | |
console.log("EWS ID (from REST ID): " + ewsId2); | |
} | |
language: typescript | |
template: | |
content: | | |
<section class="ms-font-m"> | |
<p>This sample shows how to retrieve REST and EWS endpoint URLs and item IDs, and convert item IDs for different protocols.</p> | |
</section> | |
<section class="samples ms-font-m"> | |
<h3>Try it out</h3> | |
<button id="run" class="ms-Button"> | |
<div class="ms-Button-label">Run</div> | |
</button> | |
</section> | |
language: html | |
style: | |
content: | | |
section.samples { | |
margin-top: 20px; | |
} | |
section.samples .ms-Button, section.setup .ms-Button { | |
display: block; | |
margin-bottom: 5px; | |
margin-left: 20px; | |
min-width: 80px; | |
} | |
language: css | |
libraries: | | |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js | |
@types/office-js | |
[email protected]/dist/css/fabric.min.css | |
[email protected]/dist/css/fabric.components.min.css | |
[email protected]/client/core.min.js | |
@types/core-js | |
[email protected] | |
@types/[email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment