Skip to content

aqifcse/oauth-gmailapi-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

registration

Registration and implementation of Gmail API using Python, Fast API, SQL Alchemy

There are two ways -

Way 1: Gmail Account mail sending

  1. Place the app/credentials/desktop_client_secret.json
  2. Run the app/first_time.py with the following command
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python app/first_time.py
  1. This script will pop up a google login screen asking you to give email and password only one time. Once, the login is successfull, there will be an access-refresh-token.json file will be added automatically in the app folder.

  2. Now you can then start the server with

sudo docker-compose up --build

/register api documentation can be found in http://0.0.0.0:8000/docs

Way 2: Service Account

If you have a GSUITE admin credentials and the email has domain-wise delegation then place your credentials as service_account_credentials.json in the app/credentials/ folder

  1. Uncomment the 59th and 72th lines in app/main.py and comment out 56 and 69th lines in the same file

after that run the following command -

virtualenv venv
source venv/bin/activate
sudo docker-compose up --build

About

Registration and implementation of Gmail API using Python, Fast API, SQL Alchemy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors