Method: users.messages.modify
HTTP リクエスト
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{id}/modify
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
userId |
string
ユーザーのメールアドレス。特別な値 me を使用して、認証済みユーザーを示すことができます。
|
id |
string
変更するメッセージの ID。
|
リクエスト本文
リクエストの本文には、次の構造のデータが含まれます。
JSON 表現 |
{
"addLabelIds": [
string
],
"removeLabelIds": [
string
]
} |
フィールド |
addLabelIds[] |
string
このメッセージに追加するラベルの ID のリスト。更新ごとに最大 100 個のラベルを追加できます。
|
removeLabelIds[] |
string
このメッセージから削除するラベルの ID のリストです。更新ごとに最大 100 個のラベルを削除できます。
|
レスポンスの本文
成功した場合、レスポンスの本文には Message
のインスタンスが含まれます。
認可スコープ
次の 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 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"]]