Robert MacLean
14 July 2022
I recently created an event website and needed to create links for people to add the events to their calendars - the documentation for how to do this for Google cloud is a mess so this is what I eventually worked out.
Start with https://www.google.com/calendar/render?action=TEMPLATE
and now each piece we will add is an additional parameter.
- Title is specified as
text
, so append that to the URL if you want that. For example if I wanted the title to beWelcome
, then I would add&text=Welcome
, e.g.https://www.google.com/calendar/render?action=TEMPLATE&text=Welcome
- Date/Time is next, starting with the keyword
dates
. Here we specify the date as YYYYMMDD, e.g. 1 July 2022 is20220701
, and times are formatted as HHMMSS, e.g. 8:30 am is083000
. The date and time are seperated with the letterT
and the starting and end pieces are seperated with/
. For example if we start the Welcome at 8:30am on 1 July 2022 and it ends at 10am - the value would be20220701T083000/20220701T100000
. - Timezone is optional, and without it you get GMT. If you want to specify a timezone, use
ctz
and the value is a tz database entry. For example, if you want South Africa it will beAfrica/Johannesburg
. - Location is also optional and it is the key
location
with free form text in it.
If we put the above together as an example you get https://www.google.com/calendar/render?action=TEMPLATE&text=Welcome&dates=20220701T083000/20220701T100000&ctz=Africa/Johannesburg&Location=Boardroom
Notes:
- You must URL encode the values you use. For example, if you had a title of
Welcome Drinks
, it needs to beWelcome%20Drinks
- There are other parameters for description etc… but I never used them so I do not have them documented anymore.