This article covers the creation of a Google Calendar watcher notification handler.
Room resources inside Google Calendar allow watchers to be set up against individual calendars such as room resources. These watchers send updates to a predefined URL about changes that have taken place in the calendar of a specified resource. It may be required to create a Google Calendar notification handler application in your own GCP in order to allow RICOH Spaces to stay in sync with your Google resource calendars. This article gives you step by step instructions on how to do this.
1) Set up a Cloud Run service in GCP
The first step is to set up a Cloud Run service in GCP, this is a low-cost option by default but allows for large scalability if needed.
Once in Cloud Run click Create Service, it will bring up a new screen where you need to fill out key information such as Country, and Terms of service, name and deployment region. These are up to you, but we recommend naming it something identifiable to the RICOH Spaces platform.
It is important that the region is set to europe-west1 (Belgium)
Once completed click Next. This sets up the deployment source for the service, it also is the place where you define any environment variables for the deployment. This is important.
Select Deploy one revision from an existing container image and enter this value:
europe-west3-docker.pkg.dev/ricoh-smart-spaces/spaces-public-eu/google-watcher-notifications:release-latest
Next, open the Advanced Settings area and select Variables. Inside the Variables area select Add Variable and enter the following Name/Value pairs:
NOTIFICATION_URL = https://api.ricohspaces.app/notifications
Click Next again and select the following options:
Allow all traffic
Allow unauthenticated invocations
Click create and your new Cloud Run service will be fully enabled.
2) Map a Domain to the service
Once the service has been created you will be able to map a custom domain to it. To do this open the cloud run window.
Select Manage Custom Domains then select Add Mapping. At this point, a new window will appear asking you to select the service you want to map the domain to. You should enter a subdomain here, it can be anything but we recommend something identifiable to the RICOH Spaces platform.
How do you decide on a domain? The domain should be something that you own and should be listed inside your GCP Domain Verification area. If this area is empty you will need to add a domain and complete all the necessary steps.
To complete the process you will be asked to update your DNS records. You now have a new cloud run service that is mapped to a domain. It is important that the domain is known by the service account given to RICOH Spaces.