> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the Microsoft Graph Action Templates

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Use prebuilt Microsoft Graph action templates to auto-create dialog tasks for managing events, to-do lists, and email.

**To access templates:**

1. Go to **Automation AI** > **Use Cases** > **Dialogs** and click **Create a Dialog Task**.

2. Under **Integration**, select **Microsoft Graph**.

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img2.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=536889405075568db5eb3df27bcd9225" alt="Integration - Microsoft Graph" width="798" height="903" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img2.png" />

3. If no integration is configured, click **Explore Integrations** to set one up. See [Actions Overview](/ai-for-service/integrations/overview#actions).

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img3.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=b9b47f0f7dd04ced3f9978647bc039d7" alt="Explore Integrations" width="892" height="906" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img3.png" />

***

## Supported Actions

| Task                 | Description                     | Method |
| -------------------- | ------------------------------- | ------ |
| List all events      | Retrieves all calendar events.  | GET    |
| List all to-do lists | Retrieves all to-do list items. | GET    |
| Create a to-do list  | Creates a to-do list.           | POST   |
| Create an event      | Creates a calendar event.       | POST   |
| Send an Email        | Sends an email to a user.       | POST   |

***

### List All Events

1. Install the template from [Microsoft Graph Action Templates](/ai-for-service/integrations/actions/configuring-the-microsoft-graph-action#step-2-install-the-microsoft-graph-action-templates).

2. The **List All Events** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img4.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=0ebdc8b1f6f0e3f60f3afbb1b974cb46" alt="List All Events dialog task is added" width="1685" height="914" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img4.png" />

   * **listallEvents** - User intent to view all events.

   * **listAllEventsService** - Bot action service to fetch all events. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img5.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=5c0f6c4fb497a4604fe880674856de38" alt="Add Response" width="1914" height="850" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img5.png" />

     **Sample Response:** (truncated)

     ```json theme={null}
     {
       "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('john.doe%40outlook.com')/events",
       "value": [
         {
           "id": "AQMkADAwATNiZmY...",
           "subject": "event test",
           "start": {"dateTime": "2022-12-10T04:30:00.0000000", "timeZone": "UTC"},
           "end": {"dateTime": "2022-12-10T05:10:00.0000000", "timeZone": "UTC"}
         }
       ]
     }
     ```

   * **listAllEventstMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img6.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=2054b8501f98682a879e82f9a8d0d1c2" alt="VA prompt to view all events" width="495" height="845" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img6.png" />

***

### List All To-Do (Tasks) Lists

1. Install the template from [Microsoft Graph Action Templates](/ai-for-service/integrations/actions/configuring-the-microsoft-graph-action#step-2-install-the-microsoft-graph-action-templates).

2. The **List All Todo Lists** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img7.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=94612ce8ab76dc25692e1b9a293b23c3" alt="List All Todo Lists dialog task is added" width="1719" height="873" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img7.png" />

   * **listAllToDolists** - User intent to view all to-do lists.

   * **listAllToDoListService** - Bot action service to fetch all to-do lists. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img8.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=18088f447f3cc3f23eeec63063fa1812" alt="Add response" width="1910" height="853" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img8.png" />

     **Sample Response:** (truncated)

     ```json theme={null}
     {
       "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('john1215%40outlook.com')/todo/lists",
       "value": [
         {"displayName": "Tasks", "isOwner": true, "wellknownListName": "defaultList"},
         {"displayName": "create List from bot", "isOwner": true}
       ]
     }
     ```

   * **listAllTodoListsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img9.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=97e8a3f1a95ab9c82273151c5b2b0350" alt="VA prompt to view All Todo Lists" width="495" height="854" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img9.png" />

***

### Create an Event

1. Install the template from [Microsoft Graph Action Templates](/ai-for-service/integrations/actions/configuring-the-microsoft-graph-action#step-2-install-the-microsoft-graph-action-templates).

2. The **Create an Event** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img10.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=ce84922d1549eb25564e142aba151fb0" alt="Create an Event dialog task is added" width="1679" height="899" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img10.png" />

   * **createEvent** - User intent to create an event.

   * **eventSubject**, **startDate**, **startTime**, **endDate**, **endTime**, **attendeesEmailAddresses** - Entity nodes.

   * **getMailboxSettingsService** - Bot action service to fetch mailbox settings.

   * **entityFormatterScript** - Script to format attendee email entities.

   * **createEventService** - Bot action service to create an event. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img11.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=f1c6547a0ce6577a592c3c707028a4a9" alt="Edit request" width="1919" height="858" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img11.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "subject": "My event 1",
       "start": {"dateTime": "2022-11-09T11:45", "timeZone": "India Standard Time"},
       "end": {"dateTime": "2022-11-09T11:50", "timeZone": "India Standard Time"},
       "attendees": [{"emailAddress": {"address": "john.doe@example.com"}}]
     }
     ```

   * **createEventMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img12.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=03f4122778cb6a33369196a5e468bea1" alt="VA prompt to create an event" width="497" height="848" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img12.png" />

***

### Create a To-do (Tasks) List

1. Install the template from [Microsoft Graph Action Templates](/ai-for-service/integrations/actions/configuring-the-microsoft-graph-action#step-2-install-the-microsoft-graph-action-templates).

2. The **Create a todo list** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img13.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=8871c3c541a69d8f87998bd0fd7c3f72" alt="Create a Todo list dialog task is added" width="1673" height="878" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img13.png" />

   * **createTodolist** - User intent to create a task list.

   * **listName** - Entity node for the todo list name.

   * **createTodolistService** - Bot action service to create a todo list. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img14.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=99e83ced43ec369d3d016c640eeed30c" alt="Edit request" width="1917" height="850" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img14.png" />

     **Sample Request:**

     ```json theme={null}
     {"displayName": "Postman created list3"}
     ```

     **Sample Response:**

     ```json theme={null}
     {
       "displayName": "Postman created list3 (1)",
       "isOwner": true,
       "isShared": false,
       "wellknownListName": "none"
     }
     ```

   * **createTodolistMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img15.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=70cf3769911a8430aabb4830985065b6" alt="prompt to create todo list" width="500" height="847" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img15.png" />

***

### Send an Email

1. Install the template from [Microsoft Graph Action Templates](/ai-for-service/integrations/actions/configuring-the-microsoft-graph-action#step-2-install-the-microsoft-graph-action-templates).

2. The **Send email** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img16.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=355a7d651dc1d8aa6f84e8a054213a56" alt="Send EMail dialog task is added" width="1727" height="871" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img16.png" />

   * **sendEmail** - User intent to send an email.

   * **mailSubject**, **mailContent**, **recipientsEmailAddresses** - Entity nodes.

   * **prepareEmailIdsScript** - Bot action service to format email IDs.

   * **sendEmailService** - Bot action service to send email. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img17.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=cd92d039bf39d95bc224e76ae77e4377" alt="Edit request" width="1919" height="859" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img17.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "message": {
         "subject": "Testing MS graph",
         "body": {"contentType": "Text", "content": "Integration is working fine"},
         "toRecipients": [
           {"emailAddress": {"address": "alan@abc.com"}},
           {"emailAddress": {"address": "john@abc.com"}}
         ]
       }
     }
     ```

   * **sendMailMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/ms-graph-tem-img18.png?fit=max&auto=format&n=NuCnGNJCXSVC7wUP&q=85&s=94eed721066e830426476b39806a99e8" alt="VA prompt to send email" width="500" height="797" data-path="ai-for-service/integrations/actions/images/ms-graph-tem-img18.png" />
