Method: spaces.messages.patch
تعديل رسالة هناك فرق بين الطريقتَين patch
وupdate
. تستخدِم طريقة patch
طلب patch
، بينما تستخدِم طريقة update
طلب put
. ننصحك باستخدام الطريقة patch
. على سبيل المثال، يُرجى الاطّلاع على تعديل رسالة.
تتوافق مع أنواع المصادقة التالية:
عند استخدام مصادقة التطبيق، لا يمكن للطلبات تعديل الرسائل التي أنشأها تطبيق Chat المتصل إلا.
طلب HTTP
PATCH https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}
يستخدِم عنوان URL بنية تحويل ترميز 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 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-02-27 (حسب التوقيت العالمي المتفَّق عليه)"],[[["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"]]