Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions playlists-prod/outlook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,17 @@
group: Preview APIs
api_set:
Mailbox: preview
- id: outlook-get-token-status
name: Get the status of EWS tokens in an organization
fileName: get-token-status.yaml
description: >-
Gets the status of Exchange Web Services (EWS) callback tokens in an
organization.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-token-status.yaml
group: Preview APIs
api_set:
Mailbox: preview
- id: outlook-set-displayed-body-subject
name: Temporarily set the body or subject displayed in a message (Message Read)
fileName: set-displayed-body-subject.yaml
Expand Down
11 changes: 11 additions & 0 deletions playlists/outlook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,17 @@
group: Preview APIs
api_set:
Mailbox: preview
- id: outlook-get-token-status
name: Get the status of EWS tokens in an organization
fileName: get-token-status.yaml
description: >-
Gets the status of Exchange Web Services (EWS) callback tokens in an
organization.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/get-token-status.yaml
group: Preview APIs
api_set:
Mailbox: preview
- id: outlook-set-displayed-body-subject
name: Temporarily set the body or subject displayed in a message (Message Read)
fileName: set-displayed-body-subject.yaml
Expand Down
70 changes: 70 additions & 0 deletions samples/outlook/99-preview-apis/get-token-status.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
order: 2
id: outlook-get-token-status
name: Get the status of EWS tokens in an organization
description: Gets the status of Exchange Web Services (EWS) callback tokens in an organization.
host: OUTLOOK
api_set:
Mailbox: preview
script:
content: |
document.getElementById("get-status").addEventListener("click", getTokenStatus);

function getTokenStatus() {
Office.context.mailbox.diagnostics.ews.getTokenStatusAsync((result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.log(result.error.message);
return;
}

const status = result.value;
switch (status) {
case 0:
console.log("EWS callback tokens are enabled.");
break;
case 1:
console.log("EWS callback tokens are disabled.");
break;
case 2:
console.log(
"The organization has an Exchange Online environment. Legacy Exchange tokens are no longer supported.",
);
break;
}
});
}
language: typescript
template:
content: |-
<section class="ms-Fabric ms-font-m">
<p>This sample shows how to determine if Exchange Web Services (EWS) callback tokens are supported in an organization.
<p>
<b>Required mode</b>: Compose or Read
</p>
</p>
</section>
<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<button id="get-status" class="ms-Button">
<span class="ms-Button-label">Get token status</span>
</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/beta/hosted/office.js
https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/office-js-preview/index.d.ts

https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
1 change: 1 addition & 0 deletions view-prod/outlook.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@
"outlook-send-async": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/send-async.yaml",
"outlook-other-item-apis-get-loaded-message-properties": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/90-other-item-apis/get-loaded-message-properties.yaml",
"outlook-get-set-isalldayevent": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml",
"outlook-get-token-status": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-token-status.yaml",
"outlook-set-displayed-body-subject": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/set-displayed-body-subject.yaml"
}
1 change: 1 addition & 0 deletions view/outlook.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@
"outlook-send-async": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/90-other-item-apis/send-async.yaml",
"outlook-other-item-apis-get-loaded-message-properties": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/90-other-item-apis/get-loaded-message-properties.yaml",
"outlook-get-set-isalldayevent": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml",
"outlook-get-token-status": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/get-token-status.yaml",
"outlook-set-displayed-body-subject": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/outlook/99-preview-apis/set-displayed-body-subject.yaml"
}