Method: users.messages.modify
Belirtilen iletideki etiketleri değiştirir.
HTTP isteği
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{id}/modify
URL, gRPC Kod Dönüştürme söz dizimini kullanır.
Yol parametreleri
Parametreler |
userId |
string
Kullanıcının e-posta adresi. me özel değeri, kimliği doğrulanmış kullanıcıyı belirtmek için kullanılabilir.
|
id |
string
Değiştirilecek iletinin kimliği.
|
İstek içeriği
İstek gövdesi, aşağıdaki yapıya sahip verileri içerir:
JSON gösterimi |
{
"addLabelIds": [
string
],
"removeLabelIds": [
string
]
} |
Alanlar |
addLabelIds[] |
string
Bu iletiye eklenecek etiketlerin kimliklerinin listesi. Her güncellemeyle en fazla 100 etiket ekleyebilirsiniz.
|
removeLabelIds[] |
string
Bu iletiden kaldırılacak etiketlerin liste kimlikleri. Her güncellemede en fazla 100 etiket kaldırabilirsiniz.
|
Yanıt gövdesi
Başarılıysa yanıt metni, Message
öğesinin bir örneğini içerir.
Yetkilendirme kapsamları
Aşağıdaki OAuth kapsamlarından birini gerektirir:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
Daha fazla bilgi için Yetkilendirme kılavuzunu inceleyin.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-09-05 UTC.
[null,null,["Son güncelleme tarihi: 2024-09-05 UTC."],[[["This endpoint modifies labels on a specific message by adding or removing label IDs."],["The request requires the user's email address (`userId`), the message ID (`id`), and a JSON body specifying label IDs to add or remove."],["A successful response returns the updated message details."],["Authorization is required using specific OAuth scopes, such as `https://mail.google.com/` or `https://www.googleapis.com/auth/gmail.modify`."],["Users can leverage this functionality to programmatically manage email labels within their Gmail accounts."]]],["This API modifies labels on a specified Gmail message. It uses a `POST` request to the provided URL, with `userId` and `id` as path parameters, representing the user's email and the message's ID. The request body, in JSON format, includes `addLabelIds` and `removeLabelIds` arrays of label IDs, allowing up to 100 labels per array to be added or removed. Successful requests return a Message instance and require OAuth scopes `https://mail.google.com/` or `https://www.googleapis.com/auth/gmail.modify`.\n"]]