Method: users.messages.batchDelete
Usuwa wiele wiadomości według identyfikatora. Nie gwarantuje, że wiadomości nie zostały wcześniej usunięte ani w ogóle nie istniały.
Żądanie HTTP
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchDelete
Adres URL używa składni transkodowania gRPC.
Parametry ścieżki
Parametry |
userId |
string
Adres e-mail użytkownika. Do wskazywania uwierzytelnionego użytkownika można użyć wartości specjalnej me .
|
Treść żądania
Treść żądania zawiera dane o następującej strukturze:
Zapis JSON |
{
"ids": [
string
]
} |
Pola |
ids[] |
string
Identyfikatory wiadomości do usunięcia.
|
Treść odpowiedzi
Jeśli operacja się uda, treść odpowiedzi będzie pusta.
Zakresy autoryzacji
Wymaga następującego zakresu OAuth:
Więcej informacji znajdziesz w przewodniku na temat autoryzacji.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-05 UTC.
[null,null,["Ostatnia aktualizacja: 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"]]