Method: users.messages.get
Mendapatkan pesan yang ditentukan.
Permintaan HTTP
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{id}
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
userId |
string
Alamat email pengguna. Nilai khusus me dapat digunakan untuk menunjukkan pengguna yang diautentikasi.
|
id |
string
ID pesan yang akan diambil. ID ini biasanya diambil menggunakan messages.list . ID juga terdapat dalam hasil saat pesan disisipkan (messages.insert ) atau diimpor (messages.import ).
|
Parameter kueri
Parameter |
format |
enum (Format )
Format untuk menampilkan pesan.
|
metadataHeaders[] |
string
Jika diberikan dan formatnya adalah METADATA , hanya sertakan header yang ditentukan.
|
Isi permintaan
Isi permintaan harus kosong.
Isi respons
Jika berhasil, isi respons akan berisi instance Message
.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
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
Untuk informasi selengkapnya, lihat Panduan otorisasi.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-09-05 UTC.
[null,null,["Terakhir diperbarui pada 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"]]