5
votes

I want a way to get a list of the attachments for a Message without having to download the whole message.

With "Users.messages: get" we can set the fields to be returned but we can only choose "Payload" which will return the whole payload for the message

https://developers.google.com/gmail/api/v1/reference/users/messages/get#try-it

I only want a list of the attachments so that the user can select which attachment to go and fetch.

Is there a more efficient way to do this??

Thanks for your help,

Paul C

1

1 Answers

2
votes

Unfortunately, no there is not currently. That said, doing a get?format=FULL should be pretty efficient and not that large of a response (few hundred KB)--it won't typically return any body parts that are very large so it's mostly just metadata. Typically people don't want just a list of attachments but also metadata about those attachments (filename, size, type, disposition, where they are in the MIME tree since a top-level attachment may not make sense to surface the same way as an attachment inside a .eml attachment, etc).