Method: users.messages.batchDelete
Menghapus banyak pesan berdasarkan ID pesan. Tidak memberikan jaminan bahwa pesan belum dihapus atau bahkan ada sama sekali.
Permintaan HTTP
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchDelete
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
userId |
string
Alamat email pengguna. Nilai khusus me dapat digunakan untuk menunjukkan pengguna terautentikasi.
|
Isi permintaan
Isi permintaan memuat data dengan struktur berikut:
Representasi JSON |
{
"ids": [
string
]
} |
Kolom |
ids[] |
string
ID pesan yang akan dihapus.
|
Isi respons
Jika berhasil, isi respons akan kosong.
Cakupan otorisasi
Memerlukan cakupan OAuth berikut:
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."],[[["This endpoint allows you to delete multiple messages in Gmail by providing a list of message IDs."],["The request is sent as a POST request to a specific URL with the user's email address as a path parameter."],["The request body requires a JSON object containing an array of message IDs to be deleted."],["Although it doesn't guarantee the existence or prior deletion status of the messages, it efficiently processes bulk message deletions."],["Proper authorization with the `https://mail.google.com/` scope is necessary for successful execution."]]],["This document details the process of batch deleting messages in Gmail via an API. It uses a `POST` request to `https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchDelete`, specifying the user via the `userId` path parameter. The request body, in JSON format, contains an array `ids` of message IDs to be deleted. The response body is empty upon successful deletion. This action requires the `https://mail.google.com/` OAuth scope. No guarantees are made about the existence or prior deletion of specified message IDs.\n"]]