0
votes

I use this Gmail API request for fetching Gmail messages in user mailbox. I need to list messages from Trash as well. But in some cases message list got by list messages request is different from actual content of Trash folder content.

To reproduce the problem next steps can be performed:

  1. Ensure that my Trash folder is empty - no messages visible in Gmail web client and API list messages request returns 0 messages in Trash.
  2. Start creating message by pushing "COMPOSE" button in Gmail web client.
  3. Attach file to this draft message.
  4. Get messages list in Trash using Gmail API list messages request.

The request returns 1 new message in user Trash folder (with the file attached to draft mentioned above) however it`s not visible in Gmail web client. Is it normal or kind of bug? Is this a problem of Gmail web client or Gmail API?

1

1 Answers

0
votes

Based from this thread, when you upload a file to Gmail as an attachment, Gmail creates a temporary file to hold the data and is then sent to Trash.

So, to get a more precise search, try adding q parameter using the advanced search syntax.

See Searching for Messages to learn more.