- To access gmail API. You would need to get access. Login into
console.cloud.google.com
. Click on the tab shown in the image below.
- Next screen, you would see would be same as below. Here, follow the arrow.
Click on
create project
option.
- Fill in the details i.e Project Name. And, then click on create app. As pointed by the arrow in image.
- Once project is created. You will be redirected to the homescreen.
Now, in the right hand side tab. Select name of your newly created project.
Here,
assignment
. Click on enable APIs and services. Follow the arrow.
- Click on enable APIs and services. Follow the arrow. Search for gmail API.
-
From the result. Select GMAIL API. Click on Enable. To enable GMAIL API. From here, you'll be redirected back to API and services screen.
-
From the left hand side menu. Select Credentials. After selecting credentials. Configure consent screen. Follow the arrow.
- You'll see 2 choice boxes. Select External. Then click on create button.
- Next, you'll see app information form. Fill the following fields in the form.
- App name (Project name and app name can be same)
- User Support Email
- Developer Contact Information
- After saving the details in previous step. It'll ask you to add or remove scope. Click on Add or remove scope. And, add the below mentioned URL in the given table and save.
'https://www.googleapis.com/auth/gmail.modify'
-
Once all details are saved. Go back to credentials. Click on create credentials. And, select OAuth Client ID. From the dropdown. Select type of application as dekstop app.
-
On the next screen it will ask you to give name to the credentials. Once done. It will show client ID and client screat key. On the same screen there is option to download the credentials json. Download the file.
-
Rename the downloaded file to
credentials.json
and move it to your project folder i.eemail_client
.