Gists
This is a sample script for retrieving the access token for Service Account using Javascript. The flow for using this script is as follows.
At first, please create the Service Account and retrieve JSON file. Put Scopes, private_key and client_email to the script. Run the script. Sample script In this script, 2 libraries of jsencrypt and crypto-js are used.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jsencrypt/3.0.0-rc.1/jsencrypt.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script> <script> async function sample() { const private_key = "###"; // private_key of JSON file retrieved by creating Service Account const client_email = "###"; // client_email of JSON file retrieved by creating Service Account const scopes = ["https://www.
Original post
Superheroes are well known for wearing capes, fighting villains and looking to save the world from evil. There also are superheroes that quietly choose to use their super powers to explain technology to new users, maintain community forums, write blog posts, speak at events, host video series, create demos, share sample code and more. All in the name of helping other developers become more successful by learning new skills, delivering better apps, and ultimately enhancing their careers.
FilesApp was updated to v1.1.3.
v1.1.3 (December 12, 2020)
Access token got to be able to be given as an argument. When the access token is not given as the argument, ScriptApp.getOAuthToken() is used as the default access token. By this, the service account can be used. GitHub of FilesApp
New IDE for Google Apps Script has finally been released at December 7, 2020. Ref
I think that the speed for displaying the log is faster than old one, and the code completion also got to be easy to see.
Gists
This is a sample script for uploading the image files to the specific album in Google Photos using axios.
Before you use this script, please retrieve the access token for uploading the files using Google Photos API.
Sample script In this sample script, several image files can be uploaded.
<input type="file" id="files" name="file" multiple /> <input type="button" onclick="main()" value="upload" /> <script> function upload({ files, albumId, accessToken }) { const description = new Date().