I'm using the python version of the newly released Gmail API by Google.
The following call returns just a list of message ids:
service.users().messages().list(userId = 'me').execute()
But then I just have a list of message ids and need to iterate over them and fetch them one-by-one.
Is there a way to get the whole message content for a list of ids, in a single call ?
(Similar to how it's done in the Google Calendar API) ?
And if not supported yet, is this something that Google would like to consider adding in the API ?
Update
Here is the solution that worked for me:
batch = BatchHttpRequest()
for msg_id in message_ids:
batch.add(service.users().messages().get(userId = 'me', id = msg_id['id']), callback = mycallbackfunc)
batch.execute()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…