email - Google Rest api to get primary mail -
How to get Gmail primarily using Google's rest API Currently I'm using the GET Rest API, but it's social and promotion mail. I am referring to this site:
Its beauty straight ahead
We You can query messages using labels. Labels are of two types of system labels and user labels.
For primary, we can use the system label "INBOX" and get an email related to that category. Other system labels like CATEGORY_PROMOTIONS, CATEGORY_SOCIAL, etc. are
You can try it!
To get a label:
For a given label, tell INBOX in your case that ask questions about the message
You also have to You can get Starred, Starred from CATEGORY_PERSONAL Inbox and for important email.
Edited for sample code.
Java code is available within the sample link, but here's a snippet:
throws IOException the public static zero list label (Gmail service, string userID) {ListLabelsResponse response = Service.users (). the label (). List (userId) .execute (); & Lt; Label & gt; Label = response.get labels (); (Label labels: labels) {System.out.println (label.toPrettyString ()); }}
Comments
Post a Comment