> For the complete documentation index, see [llms.txt](https://knowledgebase.fabricdata.com/xytech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.fabricdata.com/xytech/calendar-integration-setup/calendar-integration-setup-using-system-services.md). Agents can also search and read this documentation through its [MCP server](https://knowledgebase.fabricdata.com/xytech/~gitbook/mcp).

# Calendar Integration setup using System Services

Send calendar invites directly from Xytech through Microsoft 365 or Google Calendar using the Calendar Sync Service, and read attendee responses back. Available from release 26.5M.

When people are booked, Xytech can send calendar invites to them directly through Microsoft 365 or Google Calendar, without the MPSE service. It can also read their responses back. You turn this on one division at a time.

The setup has three parts:

* **Calendar Sync Service:** stores the Microsoft 365 or Google connection and, if you want, checks for attendee responses on a schedule.
* **Division settings:** choose which divisions send invites this way.
* **Event Logs:** a list of every invite sent, every failure and every response received, so you can confirm it works.

{% hint style="info" %}
This page is for Xytech administrators. Step 1 also needs your Microsoft 365 or Google Workspace administrator.

The previous method, which sends invites through the MPSE service, is still supported for divisions you have not switched over. It is described in [Calendar Integration setup of master calendar on MS Azure or Google](https://knowledgebase.fabricdata.com/xytech/calendar-integration-setup/calendar-integration-setup-of-master-calendar-on-ms-azure-or-google-deprecated.md) and [Calendar Integration configuration](https://knowledgebase.fabricdata.com/xytech/calendar-integration-setup/calendar-integration-configuration.md).
{% endhint %}

### Before you start

You will need:

* **A master calendar account (organizer mailbox).** All invites are sent from this one mailbox, for example `xytechBookings@example.com`. If you already use calendar integration, it must be the mailbox you use today. See [If you already use calendar integration](#if-you-already-use-calendar-integration).
* **Your Microsoft 365 or Google Workspace administrator,** for Step 1.
* **Permission in Xytech** to edit System Services and Scheduling Preferences.
* **Resources, phases and event triggers set up for calendar invites,** as described in [Calendar Integration configuration](https://knowledgebase.fabricdata.com/xytech/calendar-integration-setup/calendar-integration-configuration.md). Invites go to the email address on each booked resource.

### Step 1: Register Xytech with Microsoft 365 or Google

Xytech connects as an application, then sends invites from the master calendar account. If you already completed [Calendar Integration setup of master calendar on MS Azure or Google](https://knowledgebase.fabricdata.com/xytech/calendar-integration-setup/calendar-integration-setup-of-master-calendar-on-ms-azure-or-google-deprecated.md), you can reuse those credentials and skip to Step 2.

#### Microsoft 365

1. In Microsoft Entra ID, go to **App registrations** and select **New registration**.
2. Note the **Application (client) ID** and the **Directory (tenant) ID**.
3. Under **Certificates & secrets**, create a client secret and note its **Value**. Also note when it expires, because invites stop when it does.
4. Under **API permissions**, add the Microsoft Graph *application* permission **Calendars.ReadWrite**, then select **Grant admin consent**.
5. Recommended: restrict the app to the master calendar account with an Exchange Online application access policy.

#### Google Workspace

1. In the Google Cloud console, create a service account and enable the **Google Calendar API**.
2. Create a **P12** key for the service account and note its password.
3. In the Google Workspace Admin console, go to **Security > API controls > Domain-wide delegation**. Add the service account's client ID with the scope `https://www.googleapis.com/auth/calendar.events`.

### Step 2: Set up the Calendar Sync Service

One Calendar Sync Service holds the connection for all divisions that use this feature.

1. Open **System Services** and add the **Calendar Sync Service**.
2. Fill in the settings in the table below. Only the settings for your chosen provider are shown.
3. Select **Test Connection** next to the Provider setting. It confirms that Xytech can sign in and open the master calendar account's calendar.
4. Set the service schedule. This controls how often Xytech checks for attendee responses.
5. Make the service active and save.

| Setting                                | Provider      | What to enter                                                                                                               |
| -------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- |
| Provider (Graph or Google)             | Both          | `Graph` for Microsoft 365, or `Google`                                                                                      |
| Organizer / master mailbox             | Both          | The master calendar account address (required)                                                                              |
| Scope                                  | Both          | Microsoft 365: `https://graph.microsoft.com/.default`. Google: `https://www.googleapis.com/auth/calendar.events` (required) |
| Inbound response polling enabled (Y/N) | Both          | `Y` to show attendee responses in Xytech, `N` to send invites only. Default is `N`.                                         |
| Tenant Id (Graph)                      | Microsoft 365 | Directory (tenant) ID from Step 1 (required)                                                                                |
| Client Id (Graph)                      | Microsoft 365 | Application (client) ID from Step 1 (required)                                                                              |
| Client Secret (Graph)                  | Microsoft 365 | Client secret value from Step 1 (required)                                                                                  |
| Token URL                              | Microsoft 365 | `https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/token` (required)                                                |
| Base API URL                           | Microsoft 365 | `https://graph.microsoft.com/v1.0` (required)                                                                               |
| Grant Type                             | Microsoft 365 | Leave as `client_credentials`                                                                                               |
| Service Account Email (Google)         | Google        | The service account's email (required)                                                                                      |
| Certificate (PFX - Google)             | Google        | Select **Upload Certificate** and choose the P12 file (required)                                                            |
| Certificate Password (Google)          | Google        | The key's password                                                                                                          |

Secrets and certificates are stored encrypted and shown as `********`. Leave that text as it is to keep the saved value.

If a required setting is missing, the service won't start and tells you which setting to fill in.

### Step 3: Turn it on for a division

A division sends invites through the Calendar Sync Service only when both of these settings are on. Both are off by default.

1. Navigate to **Scheduling > Setup > Preferences-Scheduling** for the division.
2. Check **Configure Calendar Invitations using Event Triggers**.
3. Check **Use Calendar System Service**.
4. Save. The division's next invite goes out through the Calendar Sync Service.

The invite's subject and body come from the invite template on the event trigger's notification. Its Show As status comes from the phase's **Show Exchange Server Time As** setting. Time off shows as Out of Office, and roster entries show as Tentative.

#### Divisions you haven't switched over

Divisions without both settings on keep sending invites the way they do today. If you change a division over, invites sent before the change are still cancelled the way they were sent. You can switch a division back by unchecking **Use Calendar System Service**.

### If you already use calendar integration

{% hint style="warning" %}
If your site already sends calendar invites from Xytech, you must use the same master calendar account you use today. Enter that mailbox as the **Organizer / master mailbox** in Step 2.
{% endhint %}

Invites that are already in people's calendars belong to that mailbox. Xytech can update or cancel them only through the same mailbox. If you use a different one, changes to existing bookings fail and people keep the old invites.

Before you switch a division over:

1. Find the master calendar account your current calendar integration sends invites from.
2. Make sure the app registration from Step 1 can access that mailbox. Include it in any Exchange Online application access policy.
3. Run **Test Connection** with that mailbox entered.
4. Switch over one division first and check an existing booking. Change its time and confirm the attendee's invite updates.

### Step 4: Check it works

Test with one booking before you rely on it.

1. In a division you switched over, book a resource that has an email address. Use a booking your event trigger rule covers.
2. Check that the invite appears in the master calendar account's calendar and in the resource's inbox.
3. Open **Event Logs** and filter the source to `CalendarSystemService`. You should see the entries below.
4. If response checking is on, accept the invite as the resource. After the next scheduled check, the booking's calendar status changes from Sent to Accepted.
5. Delete the booking and check that the invite is cancelled.

| Event type     | When it appears                                           | What it tells you                                             |
| -------------- | --------------------------------------------------------- | ------------------------------------------------------------- |
| TriggerFired   | An event trigger sends an invite                          | Which trigger fired, and for which booking                    |
| SendOutcome    | After each invite is sent, updated or cancelled           | **Info** if it worked; **Error** with the reason if it failed |
| ResponseUpdate | Only when response checking is on, after someone responds | The response: Accepted, Declined or Tentative                 |

### Troubleshooting

Start with **Event Logs**. A failed invite shows as a SendOutcome entry with severity Error and the reason from Microsoft 365 or Google.

| Problem                                                            | Likely cause                                                          | What to do                                                              |
| ------------------------------------------------------------------ | --------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| No Event Log entries at all                                        | The division isn't switched over, or no event trigger rule fired      | Check both settings in Step 3 and the event trigger rule                |
| Error: "No active CalendarSyncService configured"                  | The Calendar Sync Service is missing or inactive                      | Make the service active (Step 2)                                        |
| The service won't start                                            | A required setting is blank                                           | Fill in the setting the service names                                   |
| Test Connection signs in but then fails                            | Wrong master calendar account, or permission not granted in Step 1    | Ask your Microsoft 365 or Google administrator to recheck Step 1        |
| Invites stopped after working for months                           | The Microsoft 365 client secret expired                               | Create a new secret and enter it in Client Secret                       |
| Google: "certificate is not valid"                                 | The certificate was pasted instead of uploaded                        | Upload the P12 file again with **Upload Certificate**                   |
| Responses never appear                                             | Response checking is off, or the service has no schedule              | Set Inbound response polling to `Y` and give the service a schedule     |
| Microsoft 365: responses appear for new invites but not older ones | Invites sent before the division was switched over use a different ID | Expected. Responses are tracked only for invites sent after the switch. |
