- 06 Aug 2024
- 8 Minutes to read
- Print
- DarkLight
Exchange Web Services Module
- Updated on 06 Aug 2024
- 8 Minutes to read
- Print
- DarkLight
Module Details | |
Core or Github Module | Core Module |
Restart Required? | No |
Steps Exposed? | Yes |
Step Location | Integration > Exchange Web Services |
Settings Location | N/A settings are configured for each step |
Prerequisites |
|
The Exchange Web Services Module integrates the platform with Microsoft Exchange Servers (ex: Office 365 Exchange) in the form of pre-built steps that search and send emails, manage calendar events and contacts, and set availability with out-of-office replies.
- Effective on November 30, 2022, Microsoft will be decommissioning the production and beta API endpoints for Outlook and will be migrating to Microsoft Graph API. This will affect the ability to utilize the below module in Decisions for versions prior to 7.13 or 8.4. Users are recommended to upgrade to 7.13+ or 8.4+ in order to utilize the module without issues.
- MS Graph Endpoints no longer work with the Exchange Web Services Module.
Setting up Exchange Connection Properties
All Exchange Module steps use an ExchangeServerDefinition input with the following properties. This is used to identify the exchange server used for the connection.
Property Name | Description |
---|---|
Exchange Server URL | URL of the Exchange server (optional), typically https://<mail-server>/ews/exchange.asmx. If blank, the Windows AutoDiscovery service requires the User Email Address. |
User Email Address | SMTP account (e.g. user@domain.com) for performing Exchange Server activity |
Password & OAuth Token | Basic authentication and OAuth tokens are supported To use OAuth, please refer to the appropriate Microsoft Exchange documentation to set up OAuth authentication and to generate an OAuth Token. |
Exchange Server Version | Select the version of Microsoft Exchange |
Exchange Web Services Steps
Exchange Web Services steps can be located in the Toolbox under Integration > Exchange Web Services.
Search Emails
The Search Emails step takes in a string input and searches emails on the Exchange Server for that string.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
Offset | How many results to skip. Use 0 to retrieve results from the start of the results. This parameter is used to allow pages of results to be retrieved |
Page Size | The maximum number of results to return |
Search String | Text to search for in the Inbox. This parameter supports a subset of Microsoft’s Advanced Query Syntax, as documented here: QueryString | Microsoft Docs |
Fetch Exchange Emails
The Fetch Exchange Email step fetches all emails with the full email information including the body and any attachments that match the string from the Search Emails step.
To prevent requesting large duplicate attachments, avoid using this step repeatedly with the same Email ID.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
Ids | An array of email Ids to retrieve full information about, including Body and any Attachments. A common source for this array is the “Id [All Id]” property of the output of the Search Emails step. |
Send Exchange Email
The Send Exchange Email step sends an email to a recipient with a subject, body, and attachments. The From address will be populated using the User Email Address field found under the Exchange Server input.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
To | An array of the email address to send the email to |
CC | An array of the email address to put in the CC field of an email |
Subject | The text subject of the email |
Body | The main contents of the email message. It can be plain text or HTML. |
Reply To | An alternate email address for recipients to use when replying to this email |
Attachments | An array of FileData objects to attach to the email |
Send Exchange Reply
Send Exchange Reply sends a reply to an email.
Input Parameter | Description |
---|---|
Email Id | Id of the email being replied to |
Exchange Server | Server & authentication to use |
Reply Text | Text to insert into the Body of the reply |
Reply To All | A reply will be sent to all of the original email’s recipients and its From address. |
Forward Exchange Email
The Forward Exchange Email step forwards an email to designated recipients.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Email Id | Id of the email being forwarded |
Forward Text | Text to insert into the Body of the forwarded email |
To | An array of email address to forward the email to |
Get User Availability
The Get User Availability step returns True if the requested user has no appointments during the given time period and False if they have at least one calendar event during that period.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Email Address | SMTP Address of the user being queried |
From Date | Start Date |
To Date | End Date |
Get Out Of Office State
Returns information about any automatic replies a given user has set up.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Email Address | SMTP Address of the user |
Set Out Of Office State
Sets the Out Of Office properties for a given user on Exchange.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Email Address | SMTP Address of the user being queried |
State | Disabled (no automatic reply defined), Enabled (an automatic reply is defined and continuously active), or Scheduled (an automatic reply is set up to be active during the time window set in the Duration property) |
Start Date | Start of scheduled automatic reply |
End Date | End of scheduled automatic reply |
Internal Reply | Text to send to other users on the domain |
External Reply | Text to send to users outside of the domain |
External Audience | None, Known, All |
Search Exchange Calendar
The Search Exchange Calendar step searches for calendar events with the specified start and end dates/times and retrieves all data about the calendar event or appointment.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
End Time | End date and time of calendar |
Limit | Maximum number of results to return |
Start Time | Start date and time of calendar |
Create Exchange Calendar Item
The Create Exchange Calendar Item step allows users to create and send calendar invites.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Subject | Subject of the Calendar item |
Body | Body of Calendar item |
Start Time | Start date/time of calendar |
End Time | End date/time of calendar |
Location | Room/location name |
Required Attendees | A list of email addresses to notify |
Optional Attendees | A list of email addresses to notify (can be empty) |
Update Exchange Calendar Item
The Update Exchange Calendar Item step allows users to update a calendar event item.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Calendar Item | The Exchange Calendar Item object to update |
Delete Exchange Calendar Item
The Delete Exchange Calendar Item allows users to delete calendar event items.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
Calendar Item | Exchange Calendar Item Id object to update |
Search Exchange Contacts
The Search Exchange Contacts step retrieves all contact data that matches the search string specified.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
Search String | Text to search for in the Contacts list. |
Page Size | The maximum number of results to return |
Offset | How many results to skip. Use 0 to retrieve results from the start of the results. This parameter is used to allow pages of results to be retrieved. |
Create Exchange Contact
The Create Exchange Contact step allows users to create contacts on the Microsoft Exchange Server.
Input Parameter | Description |
---|---|
Exchange Server Definition | Server & authentication to use |
Display Name | Display Name in Exchange |
Given Name | First name |
Surname | Last name |
Email Address | SMTP email address |
Update Exchange Contact
The Update Exchange Contact step allows users to update contact information on the Microsoft Server.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
Contact | The Exchange Contact object to update |
Delete Exchange Contact
The Delete Exchange Contact step allows users to delete a specific contact on the Microsoft Exchange Server.
Input Parameter | Description |
---|---|
Exchange Server | Server & authentication to use |
Contact Id | The Exchange Contact Id object to update |
Subscribing to Exchange Events
Some users who want to find out whether a new Exchange email or calendar appointment has been created write a scheduled job that calls Search Emails periodically and looks for emails added since that previous run of the job. This involves making calls to Microsoft Exchange even when no new items are there to be found, which can increase network traffic.
A better practice is to create Exchange Event Handlers to subscribe to folders like Inbox and Calendar, and Exchange Event Flows that are run when the Exchange server notifies Decisions that something has happened in that folder. The Microsoft Exchange module allows a user to create multiple handlers and Flows to handle these events. Each handler subscribes to Exchange server events when created and is automatically re-subscribed at Decisions Services Manager startup time.
The Exchange module adds a special system folder at System > Jobs and Events > Exchange Event Handlers:
Create Exchange Event Handler
The Create Exchange Event Handler defines the events to be subscribed to, the Exchange server, and credentials to use to connect.
The Name and Description properties are for identifying handlers. The User Email Address, Password, OAuth Token, Exchange Server Version, and Exchange Server URL properties have the same function as in the Exchange Server Definition used in the Exchange module’s steps.
Parameter | Description |
---|---|
Flow to Run | Identifies a flow with Exchange Notification Handler Flow behavior to run upon receiving a notification from the Exchange server. |
Exchange Folders | Lists the folders that this handler should subscribe to. One or more folders can be selected. |
Exchange Events | Lists the events to be notified of in the selected folders. |
Exchange Event Handler Flows
The Create Exchange Event Handler Flow action creates a Flow in the Exchange Event Handlers folder with the correct Flow behavior. Four inputs are generated when the Exchange server notifies Decisions that an event has occurred. The Exchange server subscription mechanism does not include IDs of new or modified items as part of its event notifications. The Flow must be designed to implement a method that responds to these notifications and request further information about the event. Below is an overview of each input:
Parameter | Description |
---|---|
Event Type | The Exchange Event (NewMail, Created, etc.) |
Exchange Folder | The folder where the event happened (Inbox, Contacts, etc.) |
Old Exchange Folder | The source folder when the event is Copied, etc. |
Timestamp | The time on the Exchange server when the event happened. |