With the Holiday Sync Service (HSS), you can sync PeopleHR holidays to Office 365. It's a one-way sync that uses OAuth, a more secure way to connect.
⚠️Important: You need to be a tenant admin to do this.
User setup
Firstly, create two queries containing the data you wish to pull through to your Exchange server.
Holiday query
Create a holiday query with the name Holiday : Outlook Feed (DO NOT REMOVE) using the below fields and filter:
Components | Details |
Fields |
|
Filter | In the field list, select Holiday Status, then in the first filter list, select Equals and in the second list, select Approved. |
📌Note: Select all the fields listed above, or the sync won't work correctly.
Other Events query
Create a query for Other Events with the name exactly as Other Events : Outlook Feed (DO NOT REMOVE) using the below fields and filter:
Components | Details |
Fields |
|
Filter | In the field list, select Other Events Status, then in the first filter list, select Equals and in the second list, select Approved. |
Installation
The Holiday Sync Service uses a PeopleHR application programming interface (API) key to read your holiday data. To install it:
Create an API key with the Employee endpoint and access to both Holiday : Outlook Feed (DO NOT REMOVE) and Holiday and Other Events : Outlook Feed (DO NOT REMOVE) queries.
Download the HSS setup file. It includes the config app and the Windows Service components.
Unzip the file and run setup.exe.
🤓Tip: The config app Holiday Sync Service Config manages all the settings for HSS. It reads and writes all the settings in the HolidaySyncService.config file, in the installation location. By default, this is C:\Program Files\PeopleHR\Holiday Sync Service.
To get to the default location, click Next three times.
🤓Tip: To install in a different location, modify the default location.
Open the Holiday Sync Service Config app.
Select the relevant filters then click Next.
🤓Tip: If you select Office 365, the Server and Service URL auto populate.
Complete the Exchange Server and PeopleHR connection details as follows:
Server: Type the Exchange Server IP address or host name. Leave this field empty if you select Office 365.
Admin: Admin mailbox email address or login ID.
Password: Admin mailbox password.
Service Url: Read only field, showing Exchange Web Services API endpoint from Exchange Server.
TimeZone: Time zone of your Outlook client or Exchange server.
Service Interval: A value in minutes, after which service schedule repeats itself to sync the holidays.
People API key: Paste your API key in here to retrieve holiday records from People HR system.
No of Days in Past.
No of Days Ahead.
Click Save.
Register your application
Next, register the Holiday Sync Service as an application in the Azure portal. To register it:
Under Manage, click App registrations then click New Registration.
Type a display name for your application, for example, PeopleHR HolidaySync Service.
Select who can use the application.
Under Redirect URL, select Public client/native (mobile & desktop).
Type the redirect URL, then click Register.
Once you've clicked Register, when the Azure portal displays the app registration overview, copy the Application (client) ID and Directory (tenant) ID, as you need these to complete the Holiday Sync Service setup.
Configure for app-only authentication
Then, give the application access to Exchange Online. To do this:
Under Manage, click Manifest.
Find the requiredResourceAccess property, then add the following:
{ "resourceAppId": "00000002-0000-0ff1-ce00-000000000000", "resourceAccess": [ { "id": "dc890d15-9560-4a4c-9b7f-a736ec74ec40", "type": "Role" } ] }Click Save then, under Manage, click API permissions.
Make sure full_access_as_app appears on the list.
Click Grant admin consent for org then click Accept.
Under Manage, click Certificates & Secrets.
Click New client secret then type a description.
Click Add.
Alternatively, you can generate the client secret using PowerShell:
PS> Connect-AzureAD -tenantid your_azure_ad_domain_name
PS> $startDate = Get-Date
PS> $endDate = $startDate.AddYears(99)
PS> New-AzureADApplicationPasswordCredential -ObjectId objectid_from_app_ overview_page -CustomKeyIdentifier "MySecret01" -StartDate $startDate -EndDate $endDate
Once you've done this, copy the value of the new client secret and save it. You need it later.
Limit application permissions
By default, OAuth client credentials grant flow allows access to all mailboxes in an organisation on Exchange Online. We recommend you limit the application permissions to specific Exchange Online mailboxes.
Complete the Holiday Sync Service configuration
Finally, add your Azure details to the Holiday Sync Service Config app. To do this:
Open the Holiday Sync Service Config app.
From the Authentication drop-down menu, select OAuth.
Click the Office 365 tab then type the Application (client) ID, Directory (tenant) ID and Client Secret.
Click Save, then, under Windows Services, restart Holiday Sync Service.
