Thursday, December 6, 2018

Example consuming Gmail API

I share basic example, how to integrate Gmail API with Gradle

Technologies used:

1. Spring Tools Suite
4. Gradle 3.4.1
5. Java 8
8. Eclipse: Oxygen.1.a Release (4.7.1a)

Code on GitHub: https://github.com/HenryXiloj/api-gmail

Steps:

1:

Create credentials:



- if you have account on devolepers google, just on click dialgog ENABLE THE GMAIL API and create new proyect or choose exist proyect. from there page I get code for this example, below left the link on references.

- Dowload the configuration file and check the name file is credentials.json

2:

-create folder
mkdir your_proyect
cd your_proyect
-- run next command
gradle init --type basic
mkdir -p src/main/java src/main/resource
--Copy the credentials.json into src/main/resource


3: run your proyect with next command.


gradle -q run
Check de images when you run the project:




Result get my labels from my gmail.




References:

https://developers.google.com/gmail/api/quickstart/java


No comments:

Post a Comment

Automating Deployments with CronJobs in Google Kubernetes Engine (GKE)

In the realm of container orchestration, automation plays a pivotal role in streamlining operations. Google Kubernetes Engine (GKE) offers r...