# README
GMail API Token Generation
The current implementation relies on an OAuth.
Prerequisites
- install Golang
- a GMail account
Creation of client secret
- Create a new project
- Go to https://console.developers.google.com
- Switch to your work account if need be (top right)
- Create a new project dropdown, top left next to your domain
- Grant the project Calendar API access
- Click "GMail API"
- Click "Enable"
- Grab your credentials
- Click "Credentials" on the left side
- Create a new OAuth credential with type "Web application"
Example Usage
main "directory/of/client_credentials/json/file"
After a successful start you need to extract the auth code and enter it into the CLI.
http://localhost:8080/?state=state-token&code=<extract this>&scope=https://www.googleapis.com/auth/gmail.modify
The code will then create a file called request.token
, which you put in the same directory as the client_credentials.json file.