What is Google Workspace, and why should we integrate with it? The 'Google Workspace friendly application' series.

8 grudnia 2020 Wojciech Sowa

The ‘Google Workspace friendly application’ series – table of contents

  1. What is Google Workspace, and why should we integrate with it?
  2. Project configuration in Google API Console – use of Google API Client Library for JavaScript – Part I.
  3. Project configuration in Google API Console – use of Google API Client Library for JavaScript – Part II.
  4. Configuration of Oracle Database and APEX application – use of Google API Client Library for JavaScript.
  5. Project configuration in Google API Console – use of Google Service Account.
  6. Configuration of Oracle Database and APEX application – use of Google Service Account.

Introduction

Many organizations base their functioning on tools from the Google Workspace package, formerly known as Google Suite. The wide range of useful tools encourages utilizing Google Workspace in every area of ​​the company’s operations. So a key question arises – can Oracle APEX be integrated with Google Workspace in my company? Yes, of course! Recently I have faced a challenge of this kind – the project was dedicated to pharmacy and one of functionalities assumed fetching data from Google Sheet and downloading files from Google Drive. 

Google Workspace includes office applications and other productivity tools. It is a set of services provided by Google as a cloud solution. It allows the commercial use of Google applications, such as Google Docs, Google Sheets, Google Drive, etc. After purchasing access to Google Workspace, the company receives a personalized space with its domain and access to services included in the selected subscription. Working with Google Workspace tools can be done on a computer, phone, or tablet.

Google Workspace has become an alternative solution to standard office applications, especially in cases where organisations have decided to stop using office suites installed locally on computers. It is really worth integrating with Google Workspace. Otherwise, the organization exposes itself to low application performance and forces end users to switch between the business application and their resources from Google account. For many companies, Google Workspace has become one of the critical elements of the internal system infrastructure.

Google APIs

Google Workspace provides an extensive REST API, thanks to which it is possible to use the API methods from the custom application level. For example, the API allows you to add events to Google Calendar, download files from Google Drive or read data saved in Google Sheet. The application we create may look like a Google Workspace tool due to the high level of integration.

Access to Google API is available on two primary levels. The choice of access method depends on the specific API functionality and is defined in the documentation. Both Google API access methods can be configured in the Google API Console.

  • If the API call does not refer to the user’s private data, we will use the API Key. This is a string that does not change over time and does not require a periodic update. The API Key is used for the identification in transactions between our application and Google Auth server. 
  • Otherwise, when we use the API to perform CRUD operations on user’s data, we will use the OAuth 2.0 protocol. 
    • In this case we use the Access Token to authorize API access, which is valid for one hour. After this time, your application should obtain a new Access Token to communicate with Google API. 
    • You have to keep in mind that the OAuth 2.0 protocol implemented on the browser level is designed for applications that access APIs only while the user is present at the application. 
    • The alternative is to use a Service Account and call Google API without confirmation of its identity. This approach will be described in the coming articles.

What is important, Google API refers to the file’s access rights of the calling user, so if you have access to the file (you are an owner of the file or it is shared with you), then you can access it using Google API. Otherwise, you do not.

Keywords board for integration steps

When creating an application in Oracle APEX, it would be great to have the native support in integration with the Google ecosystem. Still, it is not fully implemented by the built-in functionalities of the framework. We need to extend the existing mechanisms to make the integration with Google API effective. It can be implemented on two levels – JavaScript and PL/SQL. Each of these levels has its specificity and will be explained in the coming articles.

This article is an introduction to a series of articles about integrating with Google Workspace. The following topics will be covered:

  • Project configuration in Google API Console – use of Google API Client Library for JavaScript
  • Configuration of Oracle Database and APEX application – use of Google API Client Library for JavaScript 
  • Project configuration in Google API Console – use of Google Service Account
  • Configuration of Oracle Database and APEX application – use of Google Service Account
Tagi: , , , ,

Zapraszamy do kontaktu!

Pretius jest firmą tworząca oprogramowanie wspierające biznes.
Tworzymy aplikacje webowe wykorzystując: Java, Oracle DB, Oracle Apex, AngularJS.
Skontaktuj się z nami, aby porozmawiać o tym jak możemy pomóc w realizacji Twojego projektu!