Skip to content
Merged
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
114 changes: 114 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,114 @@
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({ isRest: false }, (result) => {
if (result.status === Office.AsyncResultStatus.Failed) {
console.log(result.error.message);
return;
}
const status = result.value;
switch (status) {
case Office.MailboxEnums.TokenStatus.Enabled:
console.log("EWS callback tokens are enabled.");
break;
case Office.MailboxEnums.TokenStatus.Disabled:
console.log("EWS callback tokens are disabled.");
break;
case Office.MailboxEnums.TokenStatus.Removed:
console.log(
"The organization has an Exchange Online environment. Legacy Exchange tokens are no longer supported.",
);
break;
}
});
}
language: typescript
template:
content: |-
<section>
<p>This sample shows how to determine if Exchange Web Services (EWS) callback tokens are supported in an
organization.
</p>
<p><b>Supported Outlook clients</b>: Web and Windows (new and classic (Version 2510, Build 19328.20000 or later))</p>
<p>
<b>Required mode</b>: Compose or Read
</p>
</section>
<section>
<h3>Try it out</h3>
<button id="get-status">Get token status
</button>
</section>
language: html
style:
content: |-
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
line-height: 1.5;
padding: 10px;
}

section {
margin-bottom: 20px;
}

h3 {
margin-top: 0;
margin-bottom: 10px;
font-size: 16px;
}

p {
margin: 0 0 10px 0;
}

button {
background-color: #0078d4;
color: white;
border: none;
padding: 8px 16px;
font-size: 14px;
cursor: pointer;
border-radius: 2px;
margin-left: 20px;
margin-bottom: 5px;
min-width: 80px;
display: block;
}

button:hover {
background-color: #106ebe;
}

button:active {
background-color: #005a9e;
}

input {
padding: 8px;
margin: 5px 0;
border: 1px solid #ccc;
border-radius: 2px;
font-size: 14px;
}

.header {
text-align: center;
background-color: #f3f2f1;
padding: 10px;
}
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
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"
}