← Google Calendar + APITemplate.io integrations

Account Information with APITemplate.io API on Upcoming Event Alert from Google Calendar API

Pipedream makes it easy to connect APIs for APITemplate.io, Google Calendar and 1000+ other apps remarkably fast.

Trigger workflow on
Upcoming Event Alert from the Google Calendar API
Next, do this
Account Information with the APITemplate.io API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Google Calendar trigger and APITemplate.io action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the Upcoming Event Alert trigger
    1. Connect your Google Calendar account
    2. Connect your Google Calendar account
    3. Select a Calendar ID
    4. Select a Event Name
    5. Configure Minutes Before
  3. Configure the Account Information action
    1. Connect your APITemplate.io account
    2. Optional- Select a API Endpoints
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Triggers based on a time interval before an upcoming event in the calendar. This source uses Pipedream's Task Scheduler. [See here](https://pipedream.com/docs/examples/waiting-to-execute-next-step-of-workflow/#step-1-create-a-task-scheduler-event-source) for more information and instructions for connecting your Pipedream account.
Version:0.0.1
Key:google_calendar-upcoming-event-alert

Google Calendar Overview

The Google Calendar API gives developers access to Google Calendar data,
allowing them to create their own applications that can read, write, and update
calendar data. With the API, users can integrate their own calendar
applications with Google Calendar, giving them the ability to manage their
calendars in one place. The API also provides the ability to search for events
and create new events.

Possible applications that could be built using the Google Calendar API
include:

  • A calendar application that integrates with Google Calendar, allowing users
    to manage their calendars in one place.
  • A calendar application that allows users to search for events and create new
    events.
  • A to-do list application that integrates with Google Calendar, allowing users
    to see their tasks and events in one place.
  • A reminder application that uses Google Calendar data to remind users of
    upcoming events.

Trigger Code

import taskScheduler from "../../../pipedream/sources/new-scheduled-tasks/new-scheduled-tasks.mjs";
import googleCalendar from "../../google_calendar.app.mjs";
import { axios } from "@pipedream/platform";

const docLink = "https://pipedream.com/docs/examples/waiting-to-execute-next-step-of-workflow/#step-1-create-a-task-scheduler-event-source";

export default {
  key: "google_calendar-upcoming-event-alert",
  name: "Upcoming Event Alert",
  description: `Triggers based on a time interval before an upcoming event in the calendar. This source uses Pipedream's Task Scheduler.
    [See here](${docLink}) for more information and instructions for connecting your Pipedream account.`,
  version: "0.0.1",
  type: "source",
  props: {
    pipedream: taskScheduler.props.pipedream,
    googleCalendar,
    db: "$.service.db",
    http: "$.interface.http",
    calendarId: {
      propDefinition: [
        googleCalendar,
        "calendarId",
      ],
    },
    eventId: {
      propDefinition: [
        googleCalendar,
        "eventId",
        (c) => ({
          calendarId: c.calendarId,
        }),
      ],
    },
    time: {
      type: "integer",
      label: "Minutes Before",
      description: "Number of minutes to trigger before the start of the calendar event.",
      min: 0,
    },
  },
  hooks: {
    async activate() {
      // workaround - self call run() because selfSubscribe() can't be run on activate or deploy
      // see selfSubscribe() method in pipedream/sources/new-scheduled-tasks/new-scheduled-tasks.mjs
      await axios(this, {
        url: this.http.endpoint,
        method: "POST",
        data: {
          schedule: true,
        },
      });
    },
    async deactivate() {
      const id = this._getScheduledEventId();
      if (id && await this.deleteEvent({
        body: {
          id,
        },
      })) {
        console.log("Cancelled scheduled event");
        this._setScheduledEventId();
      }
    },
  },
  methods: {
    ...taskScheduler.methods,
    _getScheduledEventId() {
      return this.db.get("scheduledEventId");
    },
    _setScheduledEventId(id) {
      this.db.set("scheduledEventId", id);
    },
    _hasDeployed() {
      const result = this.db.get("hasDeployed");
      this.db.set("hasDeployed", true);
      return result;
    },
    subtractMinutes(date, minutes) {
      return date.getTime() - minutes * 60000;
    },
  },
  async run(event) {
    // self subscribe only on the first time
    if (!this._hasDeployed()) {
      await this.selfSubscribe();
    }

    // incoming scheduled event
    if (event.$channel === this.selfChannel()) {
      this.emitEvent(event, `Upcoming ${event.summary} event`);
      this._setScheduledEventId();
      return;
    }

    // received schedule command
    if (event.body?.schedule) {
      const calendarEvent = await this.googleCalendar.getEvent({
        calendarId: this.calendarId,
        eventId: this.eventId,
      });

      const startTime = new Date(calendarEvent.start.dateTime || calendarEvent.start.date);
      const later = new Date(this.subtractMinutes(startTime, this.time));

      const scheduledEventId = this.emitScheduleEvent(calendarEvent, later);
      this._setScheduledEventId(scheduledEventId);
    }
  },
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
Google CalendarpipedreamappThis component uses the Google Calendar app.
Google CalendargoogleCalendarappThis component uses the Google Calendar app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
N/Ahttp$.interface.httpThis component uses $.interface.http to generate a unique URL when the component is first instantiated. Each request to the URL will trigger the run() method of the component.
Calendar IDcalendarIdstringSelect a value from the drop down menu.
Event NameeventIdstringSelect a value from the drop down menu.
Minutes Beforetimeinteger

Number of minutes to trigger before the start of the calendar event.

Trigger Authentication

Google Calendar uses OAuth authentication. When you connect your Google Calendar account, Pipedream will open a popup window where you can sign into Google Calendar and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Calendar API.

Pipedream requests the following authorization scopes when you connect your account:

emailprofilehttps://www.googleapis.com/auth/calendar.eventshttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/calendar.settings.readonly

About Google Calendar

Scheduling calendar service developed by Google

Action

Description:Retrieves information about your account. [See the docs](https://apitemplate.io/apiv2/) for more information
Version:0.0.1
Key:apitemplate_io-account-information

APITemplate.io Overview

With the APITemplate.io API, you can easily create and manage APIs for your web
applications. You can use the API to create, update, and delete resources, as
well as to manage users and permissions.

Action Code

import app from "../../app/apitemplate_io.app.mjs";
import { defineAction } from "@pipedream/types";
export default defineAction({
    name: "Account Information",
    description: "Retrieves information about your account. [See the docs](https://apitemplate.io/apiv2/) for more information",
    key: "apitemplate_io-account-information",
    version: "0.0.1",
    type: "action",
    props: {
        app,
        apiEndpoints: {
            propDefinition: [
                app,
                "apiEndpoints",
            ],
        },
    },
    async run({ $ }) {
        const response = await this.app.getAccountInformation($, this.apiEndpoints);
        $.export("$summary", `Successfully fetched your account information, status: ${response.status}`);
        return response;
    },
});

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
APITemplate.ioappappThis component uses the APITemplate.io app.
API EndpointsapiEndpointsstringSelect a value from the drop down menu:{ "label": "Default (Singapore)", "value": "https://rest.apitemplate.io" }{ "label": "Europe (Frankfurt)", "value": "https://rest-de.apitemplate.io" }{ "label": "US East (N. Virginia)", "value": "https://rest-us.apitemplate.io" }{ "label": "Australia (Sydney)", "value": "https://rest-au.apitemplate.io" }{ "label": "Alternative Default (Singapore)", "value": "https://rest-alt.apitemplate.io" }{ "label": "Alternative Europe (Frankfurt)", "value": "https://rest-alt-de.apitemplate.io" }{ "label": "Alternative US East (N. Virginia)", "value": "https://rest-alt-us.apitemplate.io" }

Action Authentication

APITemplate.io uses API keys for authentication. When you connect your APITemplate.io account, Pipedream securely stores the keys so you can easily authenticate to APITemplate.io APIs in both code and no-code steps.

To retrieve your API key,

  • Navigate to your API Template account and sign in
  • Go to “API Integration”

About APITemplate.io

APITemplate.io allows you to auto-generate images and PDF documents with a simple API

More Ways to Connect APITemplate.io + Google Calendar

Account Information with APITemplate.io API on Event Cancelled from Google Calendar API
Google Calendar + APITemplate.io
 
Try it
Account Information with APITemplate.io API on Event Ended from Google Calendar API
Google Calendar + APITemplate.io
 
Try it
Account Information with APITemplate.io API on Event Start from Google Calendar API
Google Calendar + APITemplate.io
 
Try it
Account Information with APITemplate.io API on New Calendar from Google Calendar API
Google Calendar + APITemplate.io
 
Try it
Account Information with APITemplate.io API on Event Search from Google Calendar API
Google Calendar + APITemplate.io
 
Try it
Event Start from the Google Calendar API

Emits a specified time before an event starts

 
Try it
Upcoming Event Alert from the Google Calendar API

Triggers based on a time interval before an upcoming event in the calendar. This source uses Pipedream's Task Scheduler. See here for more information and instructions for connecting your Pipedream account.

 
Try it
New or Updated Event (Instant) from the Google Calendar API

Emit new calendar events when an event is created or updated (does not emit cancelled events)

 
Try it
New Event from the Google Calendar API

Emits when an event is created

 
Try it
Event Search from the Google Calendar API

Emit when an event is created that matches a search

 
Try it
Add Quick Event with the Google Calendar API

Create an event to the Google Calendar. See the docs here

 
Try it
Create Event with the Google Calendar API

Create an event to the Google Calendar. See the docs here

 
Try it
Delete an Event with the Google Calendar API

Delete an event to the Google Calendar. See the docs here

 
Try it
List calendars from user account with the Google Calendar API

Retrieve calendars from the user account. See the docs here

 
Try it
List Events with the Google Calendar API

Retrieve a list of event from the Google Calendar. See the docs here

 
Try it