I'm trying to get a list of emails that contain attachments, I'm getting a list of messages, each message contains 2 properties - id and threadID - I assumed that since the messages do not hold an AttachmentID property, they do not have one either.
I didn't find a way to retrieve only messages with attachments.
This is the code:
function execute() {
return gapi.client.gmail.users.messages.list({
"userId": "myid@gmail.com",
"includeSpamTrash": false,
"maxResults": 100,
}).then(function (response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function (err) { console.error("Execute error", err); });
}