REST Resource: users.messages.attachments
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร: MessagePartBody
เนื้อความของส่วนข้อความ MIME เดียว
การแสดง JSON |
{
"attachmentId": string,
"size": integer,
"data": string
} |
ช่อง |
attachmentId |
string
(หากมี) มีรหัสของไฟล์แนบภายนอกที่ดึงข้อมูลได้ในคำขอ messages.attachments.get แยกต่างหาก หากไม่มี เนื้อหาทั้งหมดของเนื้อหาข้อความจะอยู่ในช่องข้อมูล
|
size |
integer
จํานวนไบต์สําหรับข้อมูลส่วนของข้อความ (ไม่รวมการเข้ารหัส)
|
data |
string (bytes format)
ข้อมูลเนื้อหาของส่วนข้อความ MIME เป็นสตริงที่เข้ารหัส base64url อาจว่างเปล่าสำหรับประเภทคอนเทนเนอร์ MIME ที่ไม่มีเนื้อหาข้อความหรือเมื่อมีการส่งข้อมูลเนื้อหาเป็นไฟล์แนบแยกต่างหาก รหัสไฟล์แนบจะแสดงอยู่หากข้อมูลเนื้อหาอยู่ในไฟล์แนบแยกต่างหาก สตริงที่เข้ารหัส Base64
|
เมธอด |
|
รับไฟล์แนบของข้อความที่ระบุ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],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. |"]]