获取消息附件列表,而无需下载整个消息 [英] Get list of message attachments without downloading whole message

查看:47
本文介绍了获取消息附件列表,而无需下载整个消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一种无需下载整个邮件即可获取邮件附件列表的方法.

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

使用"Users.messages:获取",我们可以设置要返回的字段,但我们只能选择有效载荷",它将返回消息的整个有效载荷

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.

有没有更有效的方法?

感谢您的帮助,

Paul C

推荐答案

不幸的是,目前没有.就是说,执行get?format = FULL应该是非常有效的,而不是那么大的响应(几百KB)-它通常不会返回任何很大的主体部分,因此主要是元数据.通常,人们不仅想要一个附件列表,而且还想要有关这些附件的元数据(文件名,大小,类型,配置,它们在MIME树中的位置),因为顶级附件可能不适合以与附件相同的方式显示. .eml附件中的附件等).

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

这篇关于获取消息附件列表,而无需下载整个消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆