Skip to content

A few Python implementations of REST/SDK calls against Google's APIs.

Notifications You must be signed in to change notification settings

alfasin/Google-Admin-Directory-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google APIs

Starting with admin directory APIs we'll go through some examples of using groups and members using both the SDK as well as implement REST calls to groups.

Setup

In order to use Google APIs you first have to register in Google cloud console, create a project and set credentials (on the left menu-bar).

All the examples that we'll use are server-side, which means you have to create keys and save the generate .p12 file in a directory which is accessible from your code. When you generate the .p12 file you'll also receive an "account email" (which is your email by default, but assuming you're admin, you can create another email for your organization and use it) and "service account email" which you'll have to use in different cases (I know it's confusing - don't blame me - blame Google).

The "service account email" is generated for you and has an ugly format that looks like this: 390109889102-qmmpidjfyadcvb9pek054mmnq0sdfppr@developer.gserviceaccount.com

In order to make your life easier I'll use the naming convention:

FULL_PATH_TO_P12 = '/full/path/to/your/file.p12'
ACCOUNT_EMAIL = 'the email you are using in your organization'
SERVICE_EMAIL = 'a generated email address - see example above'

When time allows, I'll add code examples for using Google spreadsheet API as well.

Enjoy!

About

A few Python implementations of REST/SDK calls against Google's APIs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages