Question: I want to trigger some script when new calendar event is created in Google Calendar (say calling some rest API that enters event information to my database). I do not want any kind of UI that triggers the script.   
 Is it possible to achieve this using Google gadget since I do not want any UI? I would really appreciate the help as I am new to Google API.

Thanks a lot   

Shubhra

Answer: 
[Calendar API](https://developers.google.com/google-apps/calendar/) has something like notifications. See this link: [Push Notifications](https://developers.google.com/google-apps/calendar/v3/push). From documentation:

> 
> The Google Calendar API provides push notifications that let you watch
>  for changes to resources. You can use this feature to improve the
>  performance of your application. It allows you to eliminate the extra
>  network and compute costs involved with polling resources to determine
>  if they have changed. Whenever a watched resource changes, the Google
>  Calendar API notifies your application.
> 
> 
>
Google Calendar API ([relevant docs](https://developers.google.com/calendar/v3/reference/events/watch)) provides a `watch` endpoint that allows you to specify a webhook upon certain events.

To set up the webhook, you can call the Calendar API endpoint a POST request to `https://www.googleapis.com/calendar/v3/calendars/calendarId/events/watch` with the body 

```
{
  "id": string
  "type": string,
  "address": string
}

```

The `"address"` field tells Calendar what endpoint to call when there is a new Calendar event. You'll need to create and host this endpoint yourself.

Another option is to use a service like **Zapier**, which has [fantastic integrations for Google Calendar](https://zapier.com/apps/google-calendar/integrations) and makes setting up a listener (i.e. a trigger) and corresponding action very simple.