fetching email ids of only the emails in the main gmail inbox

When fetching all the emails with users.messages.list you can filter them so you will only get the emails that are on the INBOX.

Using the parameter labelIds:

enter image description here

So a call would be like:

https://gmail.googleapis.com/gmail/v1/users/me/messages?labelIds=INBOX&key=[YOUR_API_KEY]

You can test the filters on the Try this API section of the API method

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top