> 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-of-master-calendar-on-ms-azure-or-google.md).

# Calendar Integration setup of master calendar on MS Azure or Google

### Summary Integration Setup Steps:

* Create calendar platform credentials for Xytech.
* Create a master calendar account on your calendar platform.
* Configure Xytech MPSE service with the calendar integration configuration (for self-hosted sites. For Xytech hosted sites provide Technical Services with the credentials to configure).

### Microsoft Graph app registration and master calendar

#### Create app registration in Azure

Obtain the following parameter values:

* Tennent ID
* Application ID (client ID)
* Secret
* Master calendar account email

{% hint style="info" %}
***Example Azure parameters required for Xytech***

**Application ID (client ID)**: 8003b4d8-0b09-4eb7-9daf-9d26d27806ed \
**Secret**: MdC8Q\~IIgzXNaeD-7\_0nvp3F4d3uu.AVNRclLame \
**Tennent**: 94fb7681-12345-6789-a3cb-ddc177452a36 \
**Master calendar account**: <xytechBookings@example.com>
{% endhint %}

#### Steps using Microsoft Entra ID

1. Manage - App Registrations - New Registration

<div align="left"><figure><img src="/files/apG14MoKb75NZZwRTW9h" alt="" width="563"><figcaption></figcaption></figure></div>

2. Name the application e.g. Xytech Calendar Integration. (no redirect URI required)
3. Certificates & Secrets - create a Client Secret and make a note of it. (note the expiry date for when it needs regenerating)&#x20;

<figure><img src="/files/tjwVigTw8HW8gqYJw6t5" alt=""><figcaption></figcaption></figure>

4. API Permissions - add the following permissions for Microsoft Graph

* Calendars.Read
* Calendars.ReadWrite&#x20;

<figure><img src="/files/rUHSF3rgX7bYUM6v5TNs" alt=""><figcaption></figcaption></figure>

5. Expose API - Create a scope&#x20;

<figure><img src="/files/nknna5Cs9OjRB8Uw7Ss5" alt=""><figcaption></figcaption></figure>

6. On the overview display, also make a note of the Application (Client ID), Tennent ID
7. Create a user account to act as the master calendar and note the email address

### Google Calendar service account and master calendar

#### Google Service Account

This integration is intended for use with a Google Workspace account used by a business to provide calendar services to multiple individuals, not a Gmail account used by a single individual.

{% hint style="info" %}
***Example Google parameters required for Xytech***

**Service Account Email**: <xytech-services@xytech-int-00.iam.gserviceaccount.com> \
**Impersonation Email**: <xytechBookings@example.com> \
**Certificate file**: xytech-integrations-000000-9d4b9b0bae83.p12 \
**Secret**: notasecret
{% endhint %}

1. Create and configure a new Google Service Account via the Google Console at: <https://console.cloud.google.com/> Go to API & Services\Credentials and add a new Service Account.
   * Note the email of the Service Account.
   * Note the Service Account Unique ID.
2. Create a P12 key and password.
   * Download the P12 certificate file and note the file name
   * Note the password.

<figure><img src="/files/m63J4bnZvGXN3NqPKWZa" alt=""><figcaption></figcaption></figure>

3. Enable Google Calendar API (APIs and Services\Enabled APIs and services)&#x20;

<div align="left"><figure><img src="/files/TAacsvMETPwz2OsCuwYF" alt="" width="446"><figcaption></figcaption></figure></div>

4. Enable Google Workspace Domain-wide Delegation by entering the service account’s Unique ID as the Client ID, at: <https://admin.google.com/ac/owl> (Security\Access and Data Controls\Api Controls\Domain Wide Delegation) Allow the following scopes:

```
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/calendar.events
```

### Xytech configuration (for self-hosting customers)

#### Pre-reqs

Xytech App server config should be properly configured including: queue parameters for each database. e.g.&#x20;

<div align="left"><figure><img src="/files/4j6v1zOrxEmUmu6ChDoj" alt="" width="563"><figcaption></figcaption></figure></div>

#### Create private queues for calendar integration (MSMQ)

* XytechCalendar
* XytechCalendarStatus&#x20;

<div align="left"><figure><img src="/files/CPa5TmWQoAaJuPlS8uil" alt="" width="427"><figcaption></figcaption></figure></div>

Enable journal (optional for diagnostic tracing) \
Enable security for 'everyone'&#x20;

<div align="left"><figure><img src="/files/5HQNIArH3Uxg9dYLh5jn" alt="" width="536"><figcaption></figcaption></figure></div>

#### Xytech MPSE configuration

Edit the configuration file: *MediaPulseServiceEngine.exe.config*

**Listener**

Add CalendarAdaptorService and RouterQueue logging\
Set a suitable location value for the log files for the 'customlocation' parameter. \
Set level of logging for 'switchName':

* Everything
* InfoAndWarningsAndErrors
* WarningsAndErrors
* ErrorOnly

```xml
<source name="CalendarAdapterService"
		switchName="Everything"
		switchType="System.Diagnostics.SourceSwitch">
	<listeners>
		<add name="XytechListener"
			 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
			 initializeData="FileLogWriter"
			 location="Custom"
			 customLocation="C:\Program Files\Xytech\Logs"
			 logFileCreationSchedule="Daily"
			 traceOutputOptions="DateTime"
			 maxFileSize="25000000"
			 baseFileName="CalendarAdapterService"/>
		<remove name="Default"/>
	</listeners>
</source>
			<source name="RouterQueue"
		switchName="Everything"
		switchType="System.Diagnostics.SourceSwitch">
	<listeners>
		<add name="RouterQueue"
			 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
			 initializeData="FileLogWriter"
			 location="Custom"
			 customLocation="C:\Program Files\Xytech\Logs"
			 logFileCreationSchedule="Daily"
			 traceOutputOptions="DateTime"
			 maxFileSize="25000000"
			 baseFileName="RouterQueue"/>
		<remove name="Default"/>
	</listeners>
</source>
```

**RouterQueue**

Add a a calendar router queue. \
Note the name must be 'ExchangeInterface' for the MSMQ defined in the step above.

```xml
<key name="ExchangeInterface" value=".\Private$\XytechCalendar"/>
```

Example in context of the MPSE config:&#x20;

<figure><img src="/files/DpCaUznKIeKlbbMivMy5" alt="" width="563"><figcaption></figcaption></figure>

**Service Configuration for Microsoft Azure calendar**

Need values for:

* DB Name
* REST API Base URL
* Xytech DB System user & password
* Queue Names
* Azure App registration details
* Impersonation Email - master calendar

```xml
<services>
	<service name="CalendarAdapterService" type="MediaPulse.DigitalOrderServices.CalendarAdapter.CalendarAdapter">
		<keys>
			<key name="Verbose" value="Y" />
			<key name="MpDbName" value="MP_DEMO" />
			<key name="MpRestApiUri" value="http://localhost/xytech/api/v2/database/MP_DEMO" />
			<key name="MpUsername" value="xytech" />
			<key name="MpPassword" value="password" />
			<key name="QueueName" value=".\Private$\XytechCalendar" />
			<key name="StatusQueue" value=".\Private$\XytechCalendarStatus" />
			<key name="CheckEmailIntervalInSeconds" value="30" />
			<key name="CalendarProvider" value="Exchange" />
			<key name="CalendarTokenUrl" value="https://login.microsoftonline.com/94fb7681-xxxx-42ff-a3cb-ddc177452a36/oauth2/v2.0/token" />
			<key name="CalendarBaseApiUrl" value="https://graph.microsoft.com/v1.0/" />
			<key name="CalendarGrantType" value="client_credentials" />
			<key name="CalendarScope" value="https://graph.microsoft.com/.default" />
			<key name="ClientId" value="8003b4d8-xxxx-xxxx-xxxx-9d26d27806ed" />
			<key name="ClientSecret" value="f0cea19d-xxxx-xxxx-xxxx-20139c1200dc" />
			<key name="ImpersonationEmail" value="XytechCalendar@151pcl.onmicrosoft.com" />
		</keys>
	</service>
</services>
```

**Service Configuration for Google Workspace calendar**

Need values for:

* DB Name
* REST API Base URL
* Xytech DB System user & password
* Queue Names
* Service Account Email
* Impersonation Email (master calendar account)
* Certificate Name
* Certificate file Copy the certificate file into the root folder of the Xytech application – add double back-slashes.

```xml
<services>
	<service name="CalendarAdapterService" type="MediaPulse.DigitalOrderServices.CalendarAdapter.CalendarAdapter">
		<keys>
			<key name="Verbose" value="Y" />
			<key name="MpDbName" value="MP_DEMO" />
			<key name="MpRestApiUri" value="http://localhost/xytech/api/v2/database/MP_DEMO" />
			<key name="MpUsername" value="xytech" />
			<key name="MpPassword" value="password" />
			<key name="QueueName" value=".\Private$\XytechCalendar" />
			<key name="StatusQueue" value=".\Private$\XytechCalendarStatus" />
			<key name="CheckEmailIntervalInSeconds" value="30" />
			<key name="CalendarProvider" value="Google" />
			<key name="CalendarLoginUrl" value="https://accounts.google.com/o/oauth2/auth"/>
			<key name="CalendarTokenUrl" value="https://oauth2.googleapis.com/token"/>
			<key name="CalendarBaseApiUrl" value="https://www.googleapis.com/"/>
			<key name="CalendarGrantType" value="urn:ietf:params:oauth:grant-type:jwt-bearer"/>
			<key name="CalendarScope" value="https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events"/>
			<key name="ServiceAccountEmail" value="xytech@xytechcalendarintegration.iam.gserviceaccount.com"/>
			<key name="ImpersonationEmail" value="xytech@woogy.co.uk"/>
			<key name="CertificateName" value="C:\\Program Files\\Xytech\\xytechcalendarintegration-940ef64be40c.p12"/>
			<key name="CertificatePassword" value="notasecret"/>
		</keys>
	</service>
</services>
```

### Xytech UI config key parameters

#### Scheduling - Preferences

Navigate to: Scheduling - Setup - Preferences Scheduling\
Configure Calendar Invitations using Event Triggers = true

#### Phases

Enable phases for calendar invites.\
Navigate to: Job Management - Setup - Phases\
Edit the details of a selected phase.

<figure><img src="/files/IjCZ2fWV9H30ELweciWe" alt=""><figcaption></figcaption></figure>

#### Off Types

For Off Types, like shifts, vacation, days off etc... \
Enable the Off Type for the Event Trigger to work. \
Navigate to: Scheduling - Setup - Off Types \
Check 'Schedule in Exchange Server' to enable the Off Type. \
Then create the Event Trigger <br>

**Event Triggers**

Setup Event Triggers as needed for Insert, Update triggers. \
Note: Deletion is handled automatically, no Event Trigger is required. \
Upon deleting a transaction that has sent an invite, and deletion for that invite will automatically be sent. \
\- Event Code: (unimportant what the text is, use something to identify similar triggers) \
\- Send to queue: no \
\- Notify Type: Invite

Personnel Scheduling Resource setup: \
Assign email and E-Mail Booking

<figure><img src="/files/ERQ5dRY5Fce76FGMgoLc" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledgebase.fabricdata.com/xytech/calendar-integration-setup/calendar-integration-setup-of-master-calendar-on-ms-azure-or-google.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
