修改指定郵件的標籤。
HTTP 要求
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchModify
這個網址使用 gRPC 轉碼語法。
路徑參數
| 參數 | |
|---|---|
| userId | 
 使用者的電子郵件地址。特殊值  | 
要求主體
要求主體的資料會採用以下結構:
| JSON 表示法 | 
|---|
| { "ids": [ string ], "addLabelIds": [ string ], "removeLabelIds": [ string ] } | 
| 欄位 | |
|---|---|
| ids[] | 
 要修改的郵件 ID。每個要求的 ID 上限為 1000 個。 | 
| addLabelIds[] | 
 要加入郵件的標籤 ID 清單。 | 
| removeLabelIds[] | 
 要從郵件中移除的標籤 ID 清單。 | 
回應主體
如果成功,回應主體會留白。
授權範圍
需要下列其中一種 OAuth 範圍:
- https://mail.google.com/
- https://www.googleapis.com/auth/gmail.modify
詳情請參閱授權指南。