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
有关详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-05。
[null,null,["最后更新时间 (UTC):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"]]