analitics

Pages

Monday, November 19, 2018

Using Google Classroom API with python.

Today I read and test Google API with the Python programming language.
You can find a good example here.
The example shows how to read with Google Classroom API, v1.
This example can be used as a default example if you want to use googlescopes.
The Google documentation tells us:
This document lists the OAuth 2.0 scopes that you might need to request to access Google APIs, depending on the level of access you need. Sensitive scopes require review by Google and have a sensitive indicator on the Google Cloud Platform (GCP) Console's OAuth consent screen configuration page. Many scopes overlap, so it's best to use a scope that isn't sensitive. For information about each method's scope requirements, see the individual API documentation.
The script use credentials.json file created by the Google project in the folder with the python script.
The script creates automatically when the authorization flow completes a token.json file.
The control of the project can be used with the Google Cloud Console.
The result of the example script can be seen in the next image: