Mark as read mail method

Kun Dark picture Kun Dark · Oct 22, 2014 · Viewed 13.4k times · Source

How do I mark mail as read using Gmail API?

I got the thread of email

Thread thread = service.users().threads().get(userId, message.getThreadId()).execute();

but it does not have method markRead like gmail API site says it should.

Answer

Eric D picture Eric D · Oct 22, 2014

use either threads.modify() or messages.modify() (depending on scope of what you want to do) and removeLabelId of "UNREAD".

https://developers.google.com/gmail/api/v1/reference/users/threads/modify