user3204820
user3204820

Reputation: 349

What is the difference between Google Rest API and Google Apps Script Execution API

What is the difference? Can you combine Google Apps Script with Google Rest API? Or is the Execution API the alternative?

Thanks, I really appreciate it.

Upvotes: 1

Views: 2160

Answers (2)

Cameron Roberts
Cameron Roberts

Reputation: 7377

These are entirely separate.

The Google REST API's are provided by Google and allow you to interact with their services from an external location. Essentially your code can call code written by Google, to impact Google services.

The Google Apps Script Execution API allows you to expose functions you have written in Google Apps Script to be called from an external location. Essentially this allows you to call custom code which is hosted by Google from an external location.

The key difference here is that the Google REST API has nothing to do with Google Apps Script, while the Execution API is all about letting you call Google Apps Script code.

You can certainly mix both in a given project, depending on what you are trying to do. Google Apps Script can even make use of the REST API, although that is often not needed.

If you are trying to figure out which one you need, read about Google Apps Script and determine if working in that language is suitable for your project.

If you are planning to work from another language like Python or Java, then you probably need the REST API. Finally, if you want to work in Python or Java, but call some pieces of code written in Apps Script, then you should look at the Apps Script Execution API.

Upvotes: 4

Eike Pierstorff
Eike Pierstorff

Reputation: 32770

The Execution API is a REST API.

There is no such thing as the Google REST API since REST is an architecture, not a Google service. Many Google APIs have REST or at least REST-like interfaces.

REST is an acronym for representational state transfer. As per usual it is impossible to explain this without provoking dozens of comments that point out the explanation is wrong or incomplete, so I refer you to the Wikipedia page.. But important features of REST are that resources are represented by URLs and that different http verbs (get, put, post etc) can evoke different responses from the server for similar resources (which adds purposefully a few constraints, i.e. GET is not supposed to do destructive operations etc.).

So "REST" is a specific way to design an API and Google used this design for the Apps Script Execution API.

Upvotes: 3

Related Questions