# 0365\_Auth\_Fetch\_ID

0365\_Auth\_Fetch\_ID Authenticates to Microsoft's API, receives a token, and uses it to fetch the mail-related information for mail ID.

**Trigger -** takes the message ID, receiver, which is the email box containing the message ID, and server from a parent playbook and forwards them to the next block. They will be used to fetch the mail ID for the messages that the message ID identifies.

**API -** uses Microsoft's Graph API to authenticate to Office 365 and retrieves the access token. The access token is used by the next API for authorization.

**Script -** uses a Python script to encode input parameters into URL-encoded characters. It takes three input parameters from the trigger and encodes them into the syntax required by Microsoft's API.

**API -** uses Microsoft's Outlook API to extract mail information, including the header and body, from the message ID.

**Script - a** Python script processes the mail information and extracts the mail ID, subject, and sender from the header.

**End -** forwards Auth\_token, mail ID, subject, and sender to a parent playbook.
