Method: users.messages.get
คำขอ HTTP
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{id}
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
userId |
string
อีเมลของผู้ใช้ สามารถใช้ค่าพิเศษ me เพื่อระบุผู้ใช้ที่ตรวจสอบสิทธิ์แล้ว
|
id |
string
รหัสของข้อความที่จะเรียก ระบบมักจะดึงรหัสนี้โดยใช้ messages.list นอกจากนี้ รหัสจะปรากฏในผลลัพธ์เมื่อมีการแทรกข้อความ (messages.insert ) หรือนำเข้า (messages.import ) ด้วย
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
format |
enum (Format )
รูปแบบที่จะส่งกลับข้อความ
|
metadataHeaders[] |
string
หากระบุและรูปแบบเป็น METADATA ให้รวมเฉพาะส่วนหัวที่ระบุเท่านั้น
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ Message
ขอบเขตการให้สิทธิ์
ต้องมีขอบเขต OAuth อย่างใดอย่างหนึ่งต่อไปนี้
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.metadata
โปรดดูข้อมูลเพิ่มเติมที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-09-05 UTC
[null,null,["อัปเดตล่าสุด 2024-09-05 UTC"],[[["Retrieves a specific email message using the message ID and user ID."],["Allows specifying the message format (e.g., full, metadata) and specific metadata headers to include."],["Requires authorization with specific Gmail scopes, such as read-only, modify, or metadata access."],["Returns the complete message data or metadata, depending on the requested format, in the response."],["Utilizes an HTTP GET request with path and query parameters to specify the request details."]]],["This content outlines how to retrieve a specific message from a user's Gmail account. It uses a `GET` request to a URL with the user's ID and message ID as path parameters. Optional query parameters (`format`, `metadataHeaders`) refine the response. The request body must be empty, and a successful response returns a Message object. Authorization requires specific OAuth scopes, including options for read-only, modification, or metadata access.\n"]]