Public dev meeting / Google Calendar API / Using Google Calendar to insert a new event from a NodeJS application

Parent project: "Calendar and Tasks Project"

  • Summary: Part 1 of a technote where I am trying to make a NodeJS application that connects with Google Calendar API. This part covers the basic authentication.

  • Audience: developers

  • This meeting: "a07-360 — minisite - mgalli — labs — technote — Using Google Calendar API with NodeJS 225c7421-b219-41b8-ab40-a9e004179be6 Saturday, February 15⋅2:30 – 3:30pm" and ref research meeting "a07-350 — labs — calendar tasks — b5bc491d-c137-4e1c-b8ec-5580594b6144 Saturday, February 15⋅2:30 – 3:30pm"

  • Participants: Marcio S Galli

  • Text Language: en-US
  • Tags: Google Calendar, NodeJS, JavaScript

Introduction

This technote was resulted from an exploration study that I am conducting. This work consists of:

  • Learning the basics about Google Calendar API authentication, and how to perform authentication from a server-based JavaScript — using NodeJS API.

  • Learning the basics about Google Calendar API — in this case the goal is to insert a new event.

Activating Google Calendar API for you project

Once you activate, you will be directed to a Google Calendar API dashboard view for your specific app — in my case it was named "Calendar tasks".

Creating an OAUTH 2.0 Client ID access application id

Google Calendar API can be used by our app to access the Calendar of an end-user that is authenticated in a browser session. In order to act as a system (on behalf of the user) we will need to create an OAuth 2.0 Client Id using the Google API (Google API and Services) Credentials screen:

Creating a new OAuth 2.0 Client Id credential

Creating a consent screen

Download the client secret json

(Remove this) Making sure that you have credentials associated with this API

The following image shows that I have created a kind of account, a Service Account kind, that enable connections referred by Google API as server-to-server connections.

  • Draft note — I am guessing that this kind of account won't let me access my personal user calendar - which is the goal in this article.

  • Draft note — It may be the case that this account is necessary anyway, because our app will be making a connection to Google API, primarily, and then it will also access the user's calendar, on behalf of the user. Therefore, first, we should have a basic Google authentication which enables Google to know that we are a server system, as a developer. With that Google should know how to track my API access, check progress against quotas, and so on. Secondarily, as our app will access the end-user's calendar, we will end up dealing with another level of authentication.

Let's move to the NodeJS part of the story

Marcio é um empreendedor com interesse em inovação, empreendedorismo, cultura e gestão. Formado em ciências da computação, Marcio fez seu estágio de graduação no Vale do Silício em uma das empresas que marcaram a história da Internet (Netscape Communications). Posteriormente mudou-se para o Vale do Silício trabalhando para Netscape / America Online, Yahoo! e posteriormente ao voltar ao Brasil, para a Mozilla Corporation (criadores do navegador Firefox). Antes de se tornar empreendedor e consultor, Marcio pôde colaborar com vários departamentos como marketing, inovação, engenharia e em times de documentação e evangelismo. Se tornou autor de patentes internacionais e gosta de estudar e escrever para os futuros empreendedores e gestores. Marcio é apaixonado por comunicação, negócios, tecnologia e cultura. Alguns dos seus livros preferidos são High Output Management, Conscious Business, The Hard Things about Hard Things, Maslow on Management, The Startup of You, The Alliance, Zero to One, dentre outros.

Made with ❤ by Marcio and MePlex