1
votes

For example, my primary email id: [email protected] and I also use my desktop Gmail client for [email protected] on the same.

Now if I logged in via my primary email i.e [email protected] using Gmail API and want to search all the email which are sent from email: [email protected]. will Gmail API return the result, or what are the emails which will be returned in this case.

1
Can you add any details like: code used, error problem encountered? How do I ask a good question?, How to create a Minimal, Complete, and Verifiable example Show the community what you have tried.noogui

1 Answers

0
votes

Well thats a good question so i had to try.

In Gmail i also have it reading from email on my website as well as my normal gmail account.

Quick check in gmail i can search on to:[email protected] and see emails.

So lets try messages.list set user to me and q to to:[email protected]

GET https://www.googleapis.com/gmail/v1/users/me/messages?labelIds=INBOX&q=to%3Axxx%40example.com&fields=*&key={YOUR_API_KEY}


{
 "messages": [
  {
   "id": "1658a2da9a5c815a",
   "threadId": "1658a2da9a5c815a"
  },
  {
   "id": "1658484002a33298",
   "threadId": "1658484002a33298"
  },
}

It works fine.