Reputation: 3547
When I use code similar to the example code from the api documentation, the query strings which in the web interface return results don't work. This is listing messages, not retrieving them, so I don't think full vs raw helps. The scope granted is gmail.readonly
service.users().messages().list(userId=user_id, pageToken=page_token, q=query).execute()
I use 'me'
for the user_id, and I checked that it's certainly the same email. A Query for in:anywhere
on its own returns the full mail list.
Thanks for the help!
EDIT: The query in question is a single word like a name. Some of them sometimes work with 'name is:anywhere' but not consistently.
Upvotes: 1
Views: 69
Reputation: 13528
Be aware that service.users().threads().list() would be more consistent with Gmail UI search assuming the user has conversations enabled which is the Gmail UI default.
in:anywhere expands the search to Trash and Spam which is not normally included. Archived messages are normally included.
Upvotes: 2