Method: spaces.messages.patch
किसी मैसेज को अपडेट करता है. patch
और update
के तरीकों में अंतर है. patch
तरीके में patch
अनुरोध का इस्तेमाल किया जाता है, जबकि update
तरीके में put
अनुरोध का इस्तेमाल किया जाता है. हमारा सुझाव है कि आप patch
तरीके का इस्तेमाल करें. उदाहरण के लिए, मैसेज अपडेट करना देखें.
यह पुष्टि करने के लिए, इन तरीकों का इस्तेमाल करता है:
ऐप्लिकेशन की पुष्टि करने की सुविधा का इस्तेमाल करने पर, अनुरोध सिर्फ़ उन मैसेज को अपडेट कर सकते हैं जिन्हें कॉल करने वाले Chat ऐप्लिकेशन से बनाया गया है.
एचटीटीपी अनुरोध
PATCH https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}
यूआरएल में 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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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"]]