You are here

How to Build a Java CLI that calls Apps Script Execution API

Google Apps Script’s browser-based text editor and familiar JavaScript format makes it an ideal scripting language for building lightweight web apps and automating tasks by combining web development and Google services.

Apps Scripts are now accessible from outside of Google Apps thanks to the Google Apps Script Execution API. As a working example, Saqib Ali integrated an existing Idea Bank, where Seagate employees submit innovative ideas that other employees can vote for, with an Apps Script to easily manage idea submissions in a Google Spreadsheet.

This integration is reliant on the Execution API, and in this Google Quickstart, followers are shown how to build a simple Java command-line application that is able to make requests to the Google Apps Script Execution API. By incorporating this adaptability with Java’s portability, developers can create a wide range of apps or automation tools for almost any scenario.

This particular project requires Java 1.7 or greater and Gradle 2.3 or greater, and followers must begin by creating a target Apps Script for the API to call. All of the code to prepare the project and set up the sample is supplied, which should only take around 5 minutes.

The authorisation in this tutorial covers a command-line application, but a link at the bottom of the workflow provides information on how to perform authorisation in a web application. 

Original Article

Java Quickstart

 

Comments