Skip to main content

Cyware Orchestrate

Microsoft Exchange Web Services (EWS)

App Vendor: Microsoft

App Category: Messaging

Connector Version: 1.7.0

API Version: 1.0.0

About App

Microsoft Exchange Web Services (EWS) provides the functionality to enable client applications to communicate with the Exchange server. The Microsoft EWS app enables security teams to integrate with the Microsoft EWS enterprise application to access Microsoft exchange items such as calendars, contacts, and emails using API.

The Microsoft Exchange Web Services (EWS) app is configured with the Orchestrate application to perform the following actions:

Action Name

Description

Delete Email Mailbox

This action deletes recent emails from a folder from the Microsoft EWS application.

Get Emails by Filters

This action retrieves emails using filters from the Microsoft EWS application.

Get Folders From Mailbox

This action retrieves the folders from the root/Top of Information Store folder up to depth one from the Microsoft EWS application.

Get Recent Emails

This action retrieves recent emails from a folder in the Microsoft EWS application.

Send Email

This action sends an email.

Configuration Parameters

The following configuration parameters are required for the Microsoft Exchange Web Services (EWS) app to communicate with the Microsoft Exchange Web Services (EWS) enterprise application. The parameters can be configured by creating instances in the app.

Parameter

Description

Field Type

Required/Optional

Comments

Mail Server

Enter the Mail Server FQDN.

Example:

"outlook.office365.com:<port>"

Text

Required

Username

Enter the username.

Example:

“johndoe”

Text

Required

User Email ID

Enter the user email ID.

Example:

“johndoe@example.com”

Text

Required

Password

Enter the password.

Password

Required

Autodiscover

Optional preference to include or exclude autodiscover configuration.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True

  • False

Default value: False

Action: Delete Email Mailbox

This action deletes recent emails from a folder from the Microsoft EWS application.

Action Input Parameters

Parameter

Description

Field Type

Required/Optional

Comments

Folder Name

Enter the folder name.

Example:

"inbox"

Text

Required

You can retrieve the folder name using the Get Folders From Mailbox action.

Delete Type

Enter the delete type.

Example:

"trash"

Text

Required

Allowed values:

  • trash: Moves email to the trash folder.

  • soft: Deletes email but keep a copy in the recoverable items folder.

  • hard: Completely deletes an email from the mailbox.

Default value:

"trash"

Number of Emails

Enter the number of emails to be deleted.

Example:

5

Integer

Optional

Default value:

1

Example Request

[
  {
    "folder_name": "inbox",
    "delete_type": "trash",
    "count": 5
  }
]
Action: Get Emails by Filters

This action retrieves emails using filters from the Microsoft EWS application.

Action Input Parameters

Parameter

Description

Field Type

Required/Optional

Comments

Folder Name

Enter the folder name.

Example:

"inbox"

Text

Optional

Default value:

"inbox"

You can retrieve the Folder Name using the Get Folders From Mailbox action.

Email Subject

Enter the email subject.

Example:

"Malware attack"

Text

Optional

Default value:

"none"

Input Sender Email Address

Enter the email address of the sender.

Example:

"sampleuser@example.com"

Text

Optional

Default value:

"none"

Count of Emails

Enter the number of emails to be retrieved.

Example:

5

Integer

Optional

Default value:

1

Parse All Attachments

Specify if you want to pass attachments of file types besides Email, text, and JSON.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True

  • False

Default value:

True

Return Email Body as Plaintext

Specify if you want to return the email body as plain text, instead of HTML.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True

  • False

Default value:

True

Example Request

[
  {
    "folder_name": "inbox",
    "email_subject": "Malware attack",
    "sender_email_address": "sampleuser@example.com",
    "count": 5,
    "get_body_in_text": True,
    "parse_attachments": True
  }
]
Action: Get Folders From Mailbox

This action retrieves the folders from the root/Top of Information Store folder up to depth one from the Microsoft EWS application.

Action Input Parameters

This action does not require any input parameter.

Action: Get Recent Emails

This action retrieves recent emails from a folder in the Microsoft EWS application.

Action Input Parameters

Parameter

Description

Field Type

Required/Optional

Comments

Folder Name

Enter the folder name.

Example:

"inbox"

Text

Optional

You can retrieve the Folder Name using the Get Folders From Mailbox action.

Count of Emails

Enter the number of emails to be retrieved.

Example:

5

Integer

Optional

Sub Folder Name

Enter the sub-folder name.

Example:

"Inbox-2"

Text

Optional

You can retrieve the sub-folder name using the Get Folders From Mailbox action.

Unread Emails

Optional preference to read only the unread emails.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True

  • False

Default value:

True

Parse All Attachments

Optional preference to parse attachments that are included in emails.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True

  • False

Default value:

True

Read Order

Specify the preference for reading order.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True: older to newest

  • False: newer to oldest

Default value:

false

Return Email Body as Plaintext

Optional preference to return email body as plain text, instead of HTML.

Example:

$JSON[True]

Boolean

Optional

Allowed values:

  • True

  • False

Default value:

True

Example Request

[
  {
    "folder_name": "inbox",
    "count": 5,
    "sub_folder": "Inbox-2",
    "only_unread_emails": True,
    "parse_attachments": True,
    "older_email_first": False,
    "get_body_in_text": True
  }
]
Action: Send Email

This action sends an email.

Action Input Parameters

Parameter

Description

Field Type

Required/Optional

Comments

Recipients ID

Enter the comma-separated list of email IDs of the recipients.

Example:

"sampleuser1@example.com, sampleuser2@example.com"

Text

Required

Subject

Enter the email subject.

Example:

"Malware Attack"

Text

Required

Message Body

Enter the email message body.

Example:

"Attack detected"

Text

Required

CC Recipients ID

Enter the comma-separated list of email IDs of the recipients to be added in CC.

Example:

"sampleuser3@example.com, sampleuser4@example.com"

Text

Optional

BCC Recipients ID

Enter the comma-separated list of the recipients to be added in BCC.

Example:

"sampleuser5@example.com, sampleuser6@example.com"

Text

Optional

Attachments

Enter the list of local file paths for attachments.

Example:

$LIST[tmp/path/file.txt, /tmp/path/file2.txt]

List

Optional

Example Request

[
  {
    "recipients_id": "sampleuser1@example.com, sampleuser2@example.com",
    "email_subject": "Malware Attack",
    "email_body": "Attack detected",
    "cc_recipients": "sampleuser3@example.com, sampleuser4@example.com",
    "bcc_recipients": "sampleuser5@example.com, sampleuser6@example.com",
    "attachments": ["/tmp/path/file.txt", "/tmp/path/file2.txt"]
  }
]