I am working on getting large text corpus of the email. There is no API that allows reading a message in Google Group. So the alternative way is to use a Gmail account which is a member of that group. By using this Gmail I can check all the message that is sent to that group. I am using python and Gmail API to fetch the mail. The problem I face is, I couldn't fetch the emails which are from the groups.
results = service.users().messages().list(userId='me',q="from:support-dev-group@wso2.com", maxResults=10).execute()
When I replace the from:
with another normal user id it's working. When I replace the from:
with group email id it's giving zero results. Could I get the actual code to fetch the group gmails through my Gmail?
the second problem is,
when i query using someones's mail :
results = service.users().messages().list(userId='me',q="from:xyz@wso2.com", maxResults=10).execute()
I get the results like that
{'resultSizeEstimate': 82, 'messages': [{'id': '1653929b0b414390', 'threadId': '1644c19f390faf28'}, {'id': '165330aaa5bb9134', 'threadId': '16532ef13e7eec8d'}......
Here it's only returning the message id. In order to get the mail with a body with headers, I have to query again for every id. Can't I get the full JSON in one query?