# CalDAV Calendar Sync

> Since version 1.5 Easy!Appointments supports two-way synchronization with the CalDAV Calendar API that you can use to share your appointments.

Source: https://easyappointments.org/documentation/caldav-calendar-sync/

> This page will guide you through the activation of the CalDAV Calendar synchronization feature.

Since version 1.5 Easy!Appointments supports two-way synchronization with the CalDAV Calendar API. Every provider can link their CalDAV Calendar account with the application and make sure that any modification made on the schedule is synced between both systems. Easy!Appointments will add extra information (if available) to CalDAV Calendar events so that users can check event participants, reply whether they will come or not etc. Once the events are on CalDAV Calendar, they can then be synced and used by other services that support the CalDAV protocol.

So, these are the required steps for enabling the CalDAV Calendar Sync feature of Easy!Appointments.

## Enabling Sync

In comparison to Google Calendar Sync, CalDAV does not requires the activation of 3rd party API access. You can just connect to your target server using your account credentials.

### Credentials

You will need the following credentials

-   Final Calendar URL
-   Owner Username
-   Owner Password

Head to the calendar page and select the target provider record from the top left dropdown widget. Then click on Enable Sync and select CalDAV (if prompted). Finally you will just need to enter your connection credentials and submit the dialog.

#### Note that …

-   Synchronization is triggered from the Easy!Appointments backend, whenever there are changes in the appointment plan, or on a schedule by running `php index.php console sync` from a cron job (the same command covers Google Calendar too).
-   Every provider user can be synced with only one CalDAV Calendar.
-   Recurring events are synced, but they cannot be created or managed from Easy!Appointments.

## Servers on a private network

Since v1.6.0, CalDAV URLs that resolve to a private or reserved network address are rejected by default. Without that check, a URL typed into the backend could make Easy!Appointments send requests into its own internal network and report back what it found there.

A CalDAV server you run yourself on a local network is a normal setup, so since v1.6.1 you can allow it in one of two ways:

-   **When connecting.** If the host is on a private network, the connection dialog says so and offers an **Allow and connect** button. One click adds the host and carries on. It is only offered to users who may change the system settings.
-   **Up front.** Go to **Settings → Integrations → CalDAV** and add the connection URL to **Allowed Connection URLs**, one per line. Each line can be a full URL or a bare host name.

Only add servers you run yourself. Every host on that list can be reached by the synchronization, including addresses that are otherwise unreachable from outside your network.

### When synchronization fails

If a sync fails, the calendar page shows an alert saying what went wrong, with a **Configure** button that opens the CalDAV settings page.

| What you see | What it means |
| --- | --- |
| The stored connection URL could not be used | The host is not allowed, or it cannot be resolved. The message names the host, so you can add it under **Allowed Connection URLs**. |
| The server rejected the user name and the password | The credentials changed. Disable the sync and connect again. |
| The server could not be reached | The CalDAV server is down, or the URL is wrong. |
