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
מידע נוסף זמין במדריך להרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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"]]