Method: users.messages.batchModify
HTTP リクエスト
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchModify
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
userId |
string
ユーザーのメールアドレス。特別な値 me を使用して、認証済みユーザーを示すことができます。
|
リクエスト本文
リクエストの本文には、次の構造のデータが含まれます。
JSON 表現 |
{
"ids": [
string
],
"addLabelIds": [
string
],
"removeLabelIds": [
string
]
} |
フィールド |
ids[] |
string
変更するメッセージの ID。リクエストごとの ID 数の上限は 1,000 個です。
|
addLabelIds[] |
string
メッセージに追加するラベル ID のリスト。
|
removeLabelIds[] |
string
メールから削除するラベル ID のリストです。
|
レスポンスの本文
成功すると、レスポンスの本文は空になります。
認可スコープ
次の OAuth スコープのいずれかが必要です。
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
詳細については、承認ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-05 UTC。
[null,null,["最終更新日 2024-09-05 UTC。"],[[["This endpoint allows modification of labels on multiple messages in batches, by adding or removing label IDs."],["Users need to provide message IDs and desired label IDs for adding or removing."],["It uses an HTTP POST request with specific path parameters and a JSON request body structure."],["Successful execution results in an empty response body, indicating the labels were modified."],["Authorization is required, using specified OAuth scopes related to Gmail access and modification."]]],["This describes how to modify labels on Gmail messages via an HTTP POST request to `https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchModify`. The `userId` path parameter specifies the user. The request body, in JSON format, includes `ids` (message IDs), `addLabelIds`, and `removeLabelIds` to specify which labels to modify. A maximum of 1000 message IDs is allowed per request. A successful request returns an empty response body and requires specific OAuth scopes.\n"]]