Method: users.messages.modify
แก้ไขป้ายกำกับของข้อความที่ระบุ
คำขอ HTTP
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{id}/modify
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
userId |
string
อีเมลของผู้ใช้ ค่าพิเศษ me สามารถใช้เพื่อระบุผู้ใช้ที่ตรวจสอบสิทธิ์แล้ว
|
id |
string
รหัสของข้อความที่จะแก้ไข
|
เนื้อหาของคำขอ
เนื้อหาของคำขอมีข้อมูลที่มีโครงสร้างต่อไปนี้
การแสดง JSON |
{
"addLabelIds": [
string
],
"removeLabelIds": [
string
]
} |
ช่อง |
addLabelIds[] |
string
รายการรหัสของป้ายกำกับที่จะเพิ่มในข้อความนี้ คุณจะเพิ่มป้ายกำกับได้สูงสุด 100 ป้ายต่อการอัปเดตแต่ละครั้ง
|
removeLabelIds[] |
string
รหัสรายการป้ายกำกับที่จะนำออกจากข้อความนี้ คุณนำป้ายกำกับออกได้สูงสุด 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"]]