Method: users.messages.batchModify
HTTP 要求
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchModify
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
userId |
string
使用者的電子郵件地址。特殊值 me 可用來表示已通過驗證的使用者。
|
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"ids": [
string
],
"addLabelIds": [
string
],
"removeLabelIds": [
string
]
} |
欄位 |
ids[] |
string
要修改的訊息 ID。每項要求最多只能有 1000 個 ID。
|
addLabelIds[] |
string
要加入郵件的標籤 ID 清單。
|
removeLabelIds[] |
string
列出要從郵件中移除的標籤 ID。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-05 (世界標準時間)。
[null,null,["上次更新時間:2024-09-05 (世界標準時間)。"],[[["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"]]