See four different API Authentication methods presented in Apps Script, including authentication in query string, headers, and OAuth2.
I got fed up digging around in my Drive folder for old scripts to refresh my memory on the syntax, so I created this reference.
It’s not a comprehensive post on how to connect to APIs, instead, it’s a short summary of common protocols for easy reference.(If you’re new to APIs, start with my Apps Script API tutorial for beginners.)
We are currently spoilt for choice with Google Apps Script community contributions. This is a great post from Ben Collins for Google Apps Script beginners highlighting different patterns used to interact with third party websites with APIs.
An API is essentially an interface that can be used by a computer programme to retrieve or interact with another application.What is an API?
If you would like to find out more about API Ben links to his API tutorial for beginners or I have shared workshop materials for ‘Machina a machina: An introduction to APIs with Google Sheets‘.
Check out the source link for Ben’s cheat sheet and other resources 👇.
Source: API Authentication Cheat Sheet for Apps Script
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.