Cập nhật một tin nhắn. Có sự khác biệt giữa phương thức patch và update. Phương thức patch sử dụng yêu cầu patch, còn phương thức update sử dụng yêu cầu put. Bạn nên sử dụng phương thức patch. Để biết ví dụ, hãy xem phần Cập nhật thông báo.
Trong đó, {space} là mã nhận dạng của phòng Chat nơi tin nhắn được đăng và {message} là mã nhận dạng do hệ thống chỉ định cho tin nhắn. Ví dụ: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB.
Nếu đặt một mã nhận dạng tuỳ chỉnh khi tạo thông báo, bạn có thể dùng mã nhận dạng này để chỉ định thông báo trong một yêu cầu bằng cách thay thế {message} bằng giá trị trong trường clientAssignedMessageId. Ví dụ: spaces/AAAAAAAAAAA/messages/client-custom-name. Để biết thông tin chi tiết, hãy xem bài viết Đặt tên cho tin nhắn.
quotedMessageMetadata (Chỉ cho phép xoá tin nhắn được trích dẫn.)
allowMissing
boolean
Không bắt buộc. Nếu true và không tìm thấy thông báo, thì một thông báo mới sẽ được tạo và updateMask sẽ bị bỏ qua. Mã thông báo được chỉ định phải là do ứng dụng khách chỉ định, nếu không yêu cầu sẽ không thành công.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-20 UTC."],[[["\u003cp\u003eUpdates a Google Chat message using the \u003ccode\u003ePATCH\u003c/code\u003e method, preferably over the \u003ccode\u003eupdate\u003c/code\u003e method which uses \u003ccode\u003ePUT\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSupports both app and user authentication, with app authentication limited to updating messages created by the calling Chat app.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the message to update using its resource name in the URL path and the fields to update using the \u003ccode\u003eupdateMask\u003c/code\u003e query parameter.\u003c/p\u003e\n"],["\u003cp\u003eAllows creation of a new message if the original is not found when \u003ccode\u003eallowMissing\u003c/code\u003e query parameter is set to \u003ccode\u003etrue\u003c/code\u003e and a client-assigned message ID is provided.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with one of the specified OAuth scopes (\u003ccode\u003echat.bot\u003c/code\u003e, \u003ccode\u003echat.import\u003c/code\u003e, or \u003ccode\u003echat.messages\u003c/code\u003e).\u003c/p\u003e\n"]]],["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"],null,[]]