Procedures

Automation procedures in the Microsoft Outlook BDK Book.

to delete some emails

Deletes specific emails from an Outlook account.

It requires the following permissions on the scopes: Mail.ReadWrite, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

The emails to be deleted

outlook email

Yes

Examples

Delete the specified emails

...
use the above as the emails
delete the emails

to download an attachment

Download the attachment from the specified event or email.

It requires the following permissions on the application: Calendars.ReadBasic, Calendars.Read, Calendars.ReadWrite

Input Concepts

Concept
Description
Type
Required
Default Value

The attachment that will be downloaded

outlook attachment

Yes

Output Concepts

Concept
Description
Type

answer

The attachment as a file object

file

Examples

Download the attachment for the specified event

get users from office365 whose mail is "[email protected]"
get the first user
get the above's events from outlook
get the first event
get the above's attachments
get the first attachment
use the above as the attachment
download the attachment

to forward an email to a recipient

Forwards an email to a specified recipient or group of recipients.

If the email body contains Markdown formatting, it will be sent as HTML content. Otherwise, it will be sent as plain text. It requires the following permissions on the scopes: Mail.ReadWrite, Mail.ReadWrite.Shared, Mail.Send

Input Concepts

Concept
Description
Type
Required
Default Value

The email to be forwarded

outlook email

Yes

recipient

The recipient or recipients of the email

list of text or text

Yes

subject

The subject of the forwarded email

text

No

cc recipients

The cc recipients of the forwarded email

list of text or text

No

bcc recipients

The bcc recipients of the forwarded email

list of text or text

No

attachments

The attachments to be sent with the forwarded email

file

No

Examples

Forward the specified email to the specified recipients

...
use the first email as the email
the recipients are "[email protected]", "[email protected]"
forward the email to the recipients

Forward the specified email to the specified recipients with custom subject

...
use the first email as the email
the recipients are "[email protected]", "[email protected]"
forward the email to the recipients with
... the subject is "FW by me: Meeting Reminder"

Forward the specified email to the specified recipients with custom cc recipients

...
use the first email as the email
the recipients are "[email protected]", "[email protected]"
the cc recipients are "[email protected]", "[email protected]"
forward the email to the recipients with
... the cc recipients is the cc recipients

Forward the specified email to the specified recipients with custom bcc recipients

...
use the first email as the email
the recipients are "[email protected]", "[email protected]"
the bcc recipients are "[email protected]", "[email protected]"
forward the email to the recipients with
... the bcc recipients is the bcc recipients

Forward the specified email to the specified recipients with attachments

...
use the first email as the email
...
use the above as the file
...
use the above as the other file
the attachments are the file, the other file
the recipients are "[email protected]", "[email protected]"
forward the email to the recipients with
... the attachments is the attachments

to get a (group's events) from outlook

FILTER - CAPABLE

Retrieve all the events that are in the specified user's calendar.

It requires the following permissions on the application: Calendars.Read, Calendars.ReadWrite

Input Concepts

Concept
Description
Type
Required
Default Value

The user's or group's calendar from where the events will be retrieved from

office group

Yes

start date time

The start date and time of the events to be retrieved

text

Yes

end date time

The end date and time of the events to be retrieved

text

Yes

Output Concepts

Concept
Description
Type

All the events for the group

outlook event

Examples

Retrieve all events for the specified group

get groups from office365 whose mail is "[email protected]"
get the first group
get the above's events from outlook
... the start date time is "2022-07-14T12:30:00Z"
... the end date time is "2022-07-15T12:30:00Z"

Retrieve all events for the specified group whose subject matches the specified one

get groups from office365 whose mail is "[email protected]"
get the first group
get the above's events from outlook whose subject is "Birthday Party"
... the start date time is "2022-07-14T12:30:00Z"
... the end date time is "2022-07-15T12:30:00Z"

to get a (user's event's attachments)

Retrieve all the attachments that are in the specified user's event.

It requires the following permissions on the application: Calendars.ReadBasic, Calendars.Read, Calendars.ReadWrite

Input Concepts

Concept
Description
Type
Required
Default Value

The user's calendar from where the event attachments will be retrieved from

office user

Yes

The event from where the attachments will be retrieved from

outlook event

Yes

Output Concepts

Concept
Description
Type

All the attachments for the event

outlook attachment

Examples

Retrieve all attachments for the specified event

get users from office365 whose mail is "[email protected]"
get the first user
get the above's events from outlook
get the first event
get the above's attachments

to get a (user's events) from outlook

FILTER - CAPABLE

Retrieve all the events that are in the specified user's calendar.

It requires the following permissions on the application: Calendars.ReadBasic, Calendars.Read, Calendars.ReadWrite

Input Concepts

Concept
Description
Type
Required
Default Value

The user's calendar from where the events will be retrieved from

office user

Yes

Output Concepts

Concept
Description
Type

All the events for the user

outlook event

Examples

Retrieve all events for the specified user

get users from office365 whose mail is "[email protected]"
use the first user as john
get john's events from outlook

Retrieve all events for the specified user whose subject matches the specified one

get users from office365 whose mail is "[email protected]"
use the first user as john
get john's events from outlook whose subject is "Birthday Party"

Retrieve all events whose start date is after Jul 7, 2022 12:30 UTC

get users from office365 whose mail is "[email protected]"
use the first user as john
get john's events from outlook whose "start/dateTime" is greater than "2022-07-14T12:30:00Z"

to get an email folder's subfolders

FILTER - CAPABLE

Retrieve all the child email folders that are in the specified email folder.

It requires the following permissions on the scopes: Mail.Read, Mail.ReadWrite, Mail.ReadBasic, Mail.ReadBasic.All, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

The email folder from where the child folders will be retrieved

outlook email folder

Yes

Output Concepts

Concept
Description
Type

All the child email folders for the email folder

outlook email folder

Examples

Retrieve all child folders for the specified email folder

...
use the above as the email folder
get the email folder's subfolders

Retrieve all child folders for the specified email folder that match provided name

...
use the above as the email folder
get the email folder's subfolders whose "displayName" is "My Subfolder"

to get some (email folder's emails)

FILTER - CAPABLE

Retrieve emails from Outlook based on specified filters such as date, sender, and read/unread status.

It requires the following permissions on the scopes: Mail.Read, Mail.ReadWrite, Mail.ReadBasic, Mail.ReadBasic.All, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

The email folder from where the emails will be retrieved

outlook email folder

Yes

limit

The maximum number of emails to retrieve

number

No

Output Concepts

Concept
Description
Type

All the emails for the email folder

outlook email

Examples

Retrieve all emails for the specified email folder

...
use the above as the email folder
get some email folder's emails

Retrieve all emails for the specified email folder whose subject matches the specified one

...
use the above as the email folder
get some email folder's emails whose subject is "Email with attachment"

Retrieve all emails for the specified email folder whose received date is after Feb 25, 2024 12:30 UTC

...
use the above as the email folder
the date is "2024-02-25T12:30:00Z"
get the date as a datetime
use the above as the target
get some email folder's emails whose "receivedDateTime" is greater than the target

Retrieve all emails for the specified email folder whose sender matches the specified one

...
use the above as the email folder
get some email folder's emails whose "from/emailAddress/address" is "[email protected]"

Retrieve all emails for the specified email folder whose read status matches the specified one

...
use the above as the email folder
get some email folder's emails whose "isRead" is True

to get the (attachments) from an email

Retrieve the attachments from the specified email.

It requires the following permissions on the scopes: Mail.Read, Mail.ReadWrite, Mail.ReadBasic, Mail.ReadBasic.All, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

The email from where the attachments will be retrieved

outlook email

Yes

Output Concepts

Concept
Description
Type

All the attachments for the email

outlook attachment

Examples

Retrieve all attachments for the specified email

...
use the above as the email
get the attachments from the email

to mark some emails

Marks specified emails as read or unread.

It requires the following permissions on the scopes: Mail.ReadWrite, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

The emails to be marked

outlook email

Yes

read

The status to mark the emails as. True for read, False for unread.

boolean

No

True

Examples

Mark the specified emails as read

...
use the above as the emails
mark the emails

Mark the specified emails as unread

...
use the above as the emails
mark the emails with
... the read is "False"

to move an email to a target folder

Move specified Outlook emails to a target folder.

It requires the following permissions on the scopes: Mail.ReadWrite, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

email

The email or emails that will be moved

list of outlook email or outlook email

Yes

The folder where the emails will be moved

outlook email folder

Yes

Examples

Move the specified emails to the target folder

...
use the above as the emails
get some email folders from outlook
use the first email folder as the target folder
move the emails to the target folder

to reply an email

Replies to an email through Outlook with the specified details and attachments.

If the message body contains Markdown formatting, it will be sent as HTML content. Otherwise, it will be sent as plain text. It requires the following permissions on the scopes: Mail.ReadWrite, Mail.ReadWrite.Shared, Mail.Send

Input Concepts

Concept
Description
Type
Required
Default Value

The email to be replied

outlook email

Yes

message body

The body of the reply

text

Yes

subject

The subject of the reply

text

No

recipients

The recipients of the reply

list of text or text

No

cc recipients

The cc recipients of the reply

list of text or text

No

bcc recipients

The bcc recipients of the reply

list of text or text

No

attachments

The attachments to be sent with the reply

file

No

Examples

Reply to the specified email

...
use the first email as the email
reply the email with
... the message body is "Thank you for the information"

Reply to the specified email with custom subject

...
use the first email as the email
reply the email with
... the subject is "Re by me: Meeting Reminder"
... the message body is "Thank you for the information"

Reply to the specified email with custom cc recipients

...
use the first email as the email
the cc recipients are "[email protected]", "[email protected]"
reply the email with
... the cc recipients is the cc recipients

Reply to the specified email with custom bcc recipients

...
use the first email as the email
the bcc recipients are "[email protected]", "[email protected]"
reply the email with
... the bcc recipients is the bcc recipients

Reply to the specified email with attachments

...
use the first email as the email
...
use the above as the file
...
use the above as the other file
the attachments are the file, the other file
reply the email with
... the message body is "Thank you for the information"
... the attachments is the attachments

to retrieve some (email folders) from outlook

FILTER - CAPABLE

Retrieve all the email folders that are in the authenticated user's mailbox.

It requires the following permissions on the scopes: Mail.Read, Mail.ReadWrite, Mail.ReadBasic, Mail.ReadBasic.All, Mail.ReadWrite.Shared

Output Concepts

Concept
Description
Type

All the email folders for the authenticated user

outlook email folder

Examples

Retrieve all email folders for the authenticated user

retrieve some email folders from outlook

Retrieve all email folders for the authenticated user that match provided name

retrieve some email folders from outlook whose "displayName" is "Inbox"

to retrieve some (user's email folders)

FILTER - CAPABLE

Retrieve all the email folders that are in the specified user's mailbox.

It requires the following permissions on the application: Mail.Read, Mail.ReadWrite, Mail.ReadBasic, Mail.ReadBasic.All, Mail.ReadWrite.Shared

Input Concepts

Concept
Description
Type
Required
Default Value

The user whose email folders will be retrieved

office user

Yes

Output Concepts

Concept
Description
Type

All the email folders for the user

outlook email folder

Examples

Retrieve all email folders for the specified user

get users from office365 whose mail is "[email protected]"
use the first user as the user
retrieve the user's email folders

Retrieve all email folders for the specified user that match provided name

get users from office365 whose mail is "[email protected]"
use the first user as the user
retrieve the user's email folders whose "displayName" is "Inbox"

to send an email to a recipient

Sends an email through Outlook with the specified details and attachments.

If the email body contains Markdown formatting, it will be sent as HTML content. Otherwise, it will be sent as plain text. It requires the following permissions on the scopes: Mail.ReadWrite, Mail.ReadWrite.Shared, Mail.Send

Input Concepts

Concept
Description
Type
Required
Default Value

The email to be sent

outlook email

Yes

recipient

The recipient or recipients of the email

list of text or text

Yes

cc recipients

The cc recipients of the email

list of text or text

No

bcc recipients

The bcc recipients of the email

list of text or text

No

attachments

The attachments to be sent with the email

file

No

The user sending the email. Required for client credentials, otherwise, the user is the authenticated user.

office user

No

Examples

Send an email to the specified recipients

create a json
use the above as the email
set the email's subject to "Meeting Reminder"
set the email's body to "Don't forget the meeting tomorrow at 10:00 AM"
the recipients are "[email protected]", "[email protected]"
send the email to the recipients

Send an email to the specified recipients as a user

...
use the first user as the user
create a json
use the above as the email
set the email's subject to "Meeting Reminder"
set the email's body to "Don't forget the meeting tomorrow at 10:00 AM"
the recipients are "[email protected]", "[email protected]"
send the email to the recipients
... the user is the user

Send an email to the specified recipients with custom cc recipients

create a json
use the above as the email
set the email's subject to "Meeting Reminder"
set the email's body to "Don't forget the meeting tomorrow at 10:00 AM"
the recipients are "[email protected]", "[email protected]"
the cc recipients are "[email protected]", "[email protected]"
send the email to the recipients
... the cc recipients is the cc recipients

Send an email to the specified recipients with custom bcc recipients

create a json
use the above as the email
set the email's subject to "Meeting Reminder"
set the email's body to "Don't forget the meeting tomorrow at 10:00 AM"
the recipients are "[email protected]", "[email protected]"
the bcc recipients are "[email protected]", "[email protected]"
send the email to the recipients
... the bcc recipients is the bcc recipients

Send an email to the specified recipients with attachments

...
use the above as the file
...
use the above as the other file
the attachments are the file, the other file
create a json
use the above as the email
set the email's subject to "Meeting Reminder"
set the email's body to "Don't forget the meeting tomorrow at 10:00 AM"
the recipients are "[email protected]", "[email protected]"
send the email to the recipients
... the attachments is the attachments

to set an entity's event's body to a text

Retrieve all the events that are in the specified entity's calendar.

It requires the following permissions on the application: Calendars.ReadWrite

Input Concepts

Concept
Description
Type
Required
Default Value

entity

The user's or group's calendar who owns the event

office group or office user

Yes

The event that will be updated

outlook event

Yes

text

The content of the body

text

Yes

Examples

Update the body of the specified user event

get users from office365 whose mail is "[email protected]"
use the first entity as john
get john's events from outlook
use the first event as my event
set my event's body to "hello world"

Update the body of the specified group event

get groups from office365 whose mail is "[email protected]"
get the first group
get the above's events from outlook
get the first event
set the above's body to "hello world"

Last updated

Was this helpful?