diff --git a/playlists-prod/outlook.yaml b/playlists-prod/outlook.yaml
index 9a1b827b..3aa483dc 100644
--- a/playlists-prod/outlook.yaml
+++ b/playlists-prod/outlook.yaml
@@ -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
diff --git a/playlists/outlook.yaml b/playlists/outlook.yaml
index 557b89f9..9b8f1814 100644
--- a/playlists/outlook.yaml
+++ b/playlists/outlook.yaml
@@ -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
diff --git a/samples/outlook/99-preview-apis/get-token-status.yaml b/samples/outlook/99-preview-apis/get-token-status.yaml
new file mode 100644
index 00000000..7938cbf1
--- /dev/null
+++ b/samples/outlook/99-preview-apis/get-token-status.yaml
@@ -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: |-
+ This sample shows how to determine if Exchange Web Services (EWS) callback tokens are supported in an organization.
+
+ Required mode: Compose or Read
+