Chapter 17. Execution API

The Execution API is a brand-new API that enables you to run Apps Script functions from other processes via JSON REST requests, or by using a library specific to your development language. It is unusual among Apps Script–related APIs in that it is not intended to be run from Apps Script (although it can be—for example, to enable splitting and parallel execution of workloads), but rather to provide access to Apps Script capabilities from other platforms.

I’m very impressed by the potential of the Execution API, and have eagerly anticipated its release. There are libraries, quickstarts, and developer tools available for a number of platforms, as well as the REST API, on which the VBA integration solution introduced in this chapter is based.

The Execution API has some similarity to google.script.run, whose function is to enable add-on/ HtmlService communication between client and server. This capability will greatly enhance the ability of mobile-based apps and add-ons to access Apps Script functionality.

Although probably not the purpose for which it was envisioned, the Execution API is also a powerful tool to enable incremental migration from Office (or anything else) to Apps, and this chapter will concentrate on the process and code needed.

As with all the code examples, you should adapt and enhance the error handling to match your house requirements if you choose to use any of it in your projects. Note that the provided VBA libraries are primarily focused ...

Get Going GAS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.