Watch inbox and reply for incoming mail using GMAIL API

Viewed 31

I want to listen to the inbox, and when a new message arrives, I want to read the data of the unseen messages using GMAIL API. I need to read the incoming mail because I want to send a reply mail. (i.e) I am developing a mail service for my web application (servlet).

The part which I tried is that I went through GMAIL API documentation, and I found that the watch method in Gmail API is useful for listening to the users' inbox. Still, I don't understand how to use the watch method, so my servlet gets a push notification on new incoming mail and reads the new incoming mail.

Can anyone tell me the steps to achieve this?

0 Answers
Related