In this article, learn how to create an all-day event in Google Calendar.
There are two ways to create an all-day event in Google Calendar:
- Using the Google Calendar – Create New Event card
- Using the Google Calendar – Custom API Action card
- Okta Workflows
- When using the Google Calendar – Create New Event card, pass a date value that holds the date and time for the Start Time and End Time fields. This is the flow:
All-day event created in Google Calendar:
- Another option is to use the Google Calendar – Custom API Action card to create an all-day event. This is the flow:
The Object – Construct card creates a JSON object with the event title (summary), location (location), and start/end dates. The names of the fields are important (shown by arrows).
Test the card to see the JSON object created. It looks like this:
{ "summary": "💈Employee Training", "start": { "date": "2022-10-07" }, "location": "Conference room 2", "end": { "date": "2022-10-07" }}
A Custom API Action card uses an existing connection to a service (Google Calendar in this example) and allows calling any API endpoint supported by Google Calendar API.
Set the Relative URL field and any other parameters required by the API.
When calling Google Calendar API, set the Relative URL field to /v3/calendars/calendarID/events. To get a calendar’s calendarID, select the dots menu (⠇)> Setting and sharing > Integrate calendar. The calendar ID should be seen there. It is usually the email address.
So, the API endpoint will be /v3/calendars/name@company.com/events.
