Get list of message attachments without downloading whole message

亡梦爱人 提交于 2020-01-14 09:41:10

问题


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:


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).



来源:https://stackoverflow.com/questions/24485980/get-list-of-message-attachments-without-downloading-whole-message

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!