Gists
When Google APIs are used with googleapis for Python, the client is obtained as follows.
creds = service_account.Credentials.from_service_account_file(service_account_credential_file, scopes=scopes) service = build("drive", "v3", credentials=creds) In this case, when the script is run, the access token is retrieved every time. But, the expiration time of the retrieved access token is 1 hour. Here, there might be the case that you want to use the access token until the expiration time. It is considered that effectively using the access token will lead to SDGs.
Gists
This is a sample script for retrieving the access token from the service account using oauth2client and google-auth with Python.
Sample script 1 Use oauth2client.
from oauth2client.service_account import ServiceAccountCredentials SERVICE_ACCOUNT_FILE = "credentials.json" SCOPES = ["https://www.googleapis.com/auth/drive"] creds = ServiceAccountCredentials.from_json_keyfile_name(SERVICE_ACCOUNT_FILE, scopes=SCOPES) res = creds.get_access_token() access_token = res.access_token print(access_token) Sample script 2 Use google-auth. In the current stage, this method might be general.
from google.oauth2 import service_account import google.auth.transport.requests SERVICE_ACCOUNT_FILE = "credentials.
Overview This is a Node.js module to run the batch requests of Google APIs.
Description In Google APIs, there are APIs where batch requests can be run. The batch requests can run multiple API calls by one API call with the asynchronous process. By this, both the process cost and the quota cost can be reduced. Ref In Node.js, the wonderful module of googleapis for Node.js is existing. But, in the current stage, unfortunately, it seems that the googleapis for Node.
Gists
These are sample scripts for achieving the full-text search of Google Apps Script projects using Google Apps Script. I have the case that I want to search a value from Google Apps Script projects using a Google Apps Script. In this post, I would like to introduce the sample scripts for achieving the full-text search of Google Apps Script projects.
1. Full-text search from all Google Apps Script Projects of standalone type in Google Drive Before you use this script, please enable Drive API at Advanced Google services.
Gists
This is a sample script for creating quizzes in Google Form using Google Forms API with Google Apps Script. Recently, Google Forms API has been officially published, and it got to be able to be used by users. By this, quizzes in Google Form can be created using Google Forms API.
Here, there is one thing that can be achieved by Google Forms API. When Google Forms API is used, each choice in each question can be shuffled.
Finally, Google Forms API has been officially released as version 1.
Create surveys, quizzes, and more using the Google Forms API, now generally available
The Google Forms API provides programmatic access for managing Google Forms and acting on responses— empowering developers to build powerful integrations on top of Forms.
Forms API
Announcing the Google Forms API Google is proud to announce the Google Forms API! The Forms API is currently available in Restricted Beta, with Open Beta expected to follow in Q4.
Forms API