0
votes

I have the following query to search for messages from a specific email address and with specific word/words in the subject.

from:[email protected] AND subject:forgot

The above query works and returns 1 message when I use it in the Gmail's search box but it doesn't work and returns no messages with the following Request URI on OAuth 2.0 Playground:

https://www.googleapis.com/gmail/v1/users/me/messages?q=subject:lsp AND from:[email protected]

The Response is as follows:

enter image description here

Am I doing something wrong in the syntax of the Request URI for the "AND" condition? Because the following work without the "AND":

https://www.googleapis.com/gmail/v1/users/me/messages?q=subject:lsp

https://www.googleapis.com/gmail/v1/users/me/messages?q=from:[email protected]

Can you please help me with the correct Syntax for the "AND" condition? Thanks.

1

1 Answers

0
votes

I have found the error in the syntax, the correct syntax for different filter conditions is to use a comma , between different filter conditions to separate them as follows:

https://www.googleapis.com/gmail/v1/users/me/messages?q=subject:lsp, from:[email protected]