REST Resource: users.messages.attachments
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:MessagePartBody
JSON 表示法 |
{
"attachmentId": string,
"size": integer,
"data": string
} |
字段 |
attachmentId |
string
如果存在,则包含外部附件的 ID,可在单独的 messages.attachments.get 请求中检索。如果不存在,则消息部分正文的全部内容包含在 data 字段中。
|
size |
integer
消息部分数据的字节数(编码除外)。
|
data |
string (bytes format)
MIME 邮件部分的正文数据,以 base64url 编码的字符串表示。对于没有邮件正文的 MIME 容器类型,或者正文数据作为单独的附件发送时,此字段可能为空。如果正文数据包含在单独的附件中,则附件 ID 会存在。 使用 base64 编码的字符串。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# REST Resource: users.messages.attachments\n\n- [Resource: MessagePartBody](#MessagePartBody)\n - [JSON representation](#MessagePartBody.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: MessagePartBody\n-------------------------\n\nThe body of a single MIME message part.\n\n| JSON representation |\n|---------------------------------------------------------------------|\n| ``` { \"attachmentId\": string, \"size\": integer, \"data\": string } ``` |\n\n| Fields ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `attachmentId` | `string` When present, contains the ID of an external attachment that can be retrieved in a separate `messages.attachments.get` request. When not present, the entire content of the message part body is contained in the data field. |\n| `size` | `integer` Number of bytes for the message part data (encoding notwithstanding). |\n| `data` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. A base64-encoded string. |\n\n| Methods ------- ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| ### [get](/workspace/gmail/api/reference/rest/v1/users.messages.attachments/get) | Gets the specified message attachment. |"]]