Method: spaces.messages.patch
עדכון הודעה. יש הבדל בין השיטות patch
ו-update
. בשיטה patch
נעשה שימוש בבקשה מסוג patch
, ובשיטה update
נעשה שימוש בבקשה מסוג put
. מומלץ להשתמש בשיטה patch
. דוגמה לכך מופיעה במאמר עדכון הודעה.
יש תמיכה בסוגי אימות הבאים:
כשמשתמשים באימות אפליקציה, הבקשות יכולות לעדכן רק הודעות שנוצרו על ידי אפליקציית Chat שבה מתבצעת הקריאה.
בקשת HTTP
PATCH https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
message.name |
string
מזהה. שם המשאב של ההודעה. פורמט: spaces/{space}/messages/{message} כאשר {space} הוא המזהה של המרחב שבו ההודעה פורסמה, ו-{message} הוא מזהה שהמערכת הקצה להודעה. לדוגמה, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB . אם מגדירים מזהה בהתאמה אישית בזמן יצירת ההודעה, אפשר להשתמש במזהה הזה כדי לציין את ההודעה בבקשה. לשם כך, מחליפים את {message} בערך מהשדה clientAssignedMessageId . לדוגמה, spaces/AAAAAAAAAAA/messages/client-custom-name . מידע נוסף זמין במאמר מתן שם להודעה.
|
פרמטרים של שאילתה
פרמטרים |
updateMask |
string (FieldMask format)
חובה. נתיבי השדות שרוצים לעדכן. כדי להפריד בין ערכים מרובים, צריך להשתמש בפסיקים או להשתמש ב-* כדי לעדכן את כל נתיבי השדות. נכון לעכשיו, אלה נתיבי השדות הנתמכים:
|
allowMissing |
boolean
זה שינוי אופציונלי. אם true וההודעה לא נמצאים, נוצרת הודעה חדשה ו-updateMask מתעלמים ממנה. מזהה ההודעה שצוין חייב להיות הוקצה על ידי הלקוח, אחרת הבקשה תיכשל.
|
גוף הבקשה
גוף הבקשה מכיל מופע של Message
.
גוף התשובה
אם הפעולה מצליחה, גוף התגובה מכיל מופע של Message
.
היקפי הרשאה
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.messages
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-02-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-02-27 (שעון UTC)."],[[["Updates a Google Chat message using the `PATCH` method, preferably over the `update` method which uses `PUT`."],["Supports both app and user authentication, with app authentication limited to updating messages created by the calling Chat app."],["Requires specifying the message to update using its resource name in the URL path and the fields to update using the `updateMask` query parameter."],["Allows creation of a new message if the original is not found when `allowMissing` query parameter is set to `true` and a client-assigned message ID is provided."],["Requires authorization with one of the specified OAuth scopes (`chat.bot`, `chat.import`, or `chat.messages`)."]]],["This documentation outlines how to update a message using the `PATCH` method via an HTTP request to `https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}`. The `message.name` path parameter is required, specifying the message's resource name. The `updateMask` query parameter is mandatory, indicating which fields to update (e.g., text, attachments). Optionally, `allowMissing` creates a new message if one isn't found. The request and response bodies utilize the `Message` resource, and app or user authentication are supported, with specific authentication impacting permissions.\n"]]