Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mark as read mail method

Tags:

gmail-api

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.

like image 245
Kun Dark Avatar asked Oct 22 '14 15:10

Kun Dark


1 Answers

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

like image 53
Eric D Avatar answered Oct 14 '22 04:10

Eric D