Method: spaces.messages.patch
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
একটি বার্তা আপডেট করে। patch
এবং update
পদ্ধতির মধ্যে পার্থক্য আছে। patch
পদ্ধতি একটি patch
অনুরোধ ব্যবহার করে যখন update
পদ্ধতি একটি put
অনুরোধ ব্যবহার করে। আমরা patch
পদ্ধতি ব্যবহার করার পরামর্শ দিই। একটি উদাহরণের জন্য, একটি বার্তা আপডেট করুন দেখুন।
নিম্নলিখিত ধরনের প্রমাণীকরণ সমর্থন করে:
অ্যাপ প্রমাণীকরণ ব্যবহার করার সময়, অনুরোধ শুধুমাত্র কলিং চ্যাট অ্যাপ দ্বারা তৈরি বার্তা আপডেট করতে পারে।
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 । আপনি একটি বার্তা তৈরি করার সময় যদি আপনি একটি কাস্টম আইডি সেট করেন, তাহলে আপনি clientAssignedMessageId ক্ষেত্রের মান দিয়ে {message} প্রতিস্থাপন করে একটি অনুরোধে বার্তাটি নির্দিষ্ট করতে এই ID ব্যবহার করতে পারেন। উদাহরণস্বরূপ, 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 সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-20 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["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,["# Method: spaces.messages.patch\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages).\n\nSupports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):\n\n- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope:\n\n - `https://www.googleapis.com/auth/chat.bot`\n- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.messages`\n - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)\n\nWhen using app authentication, requests can only update messages created by the calling Chat app.\n\n### HTTP request\n\n`PATCH https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `message.name` | `string` Identifier. Resource name of the message. Format: `spaces/{space}/messages/{message}` Where `{space}` is the ID of the space where the message is posted and `{message}` is a system-assigned ID for the message. For example, `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing `{message}` with the value from the `clientAssignedMessageId` field. For example, `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name a message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message). |\n\n### Query parameters\n\n| Parameters ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Required. The field paths to update. Separate multiple values with commas or use `*` to update all field paths. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cardsV2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `accessoryWidgets` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `quotedMessageMetadata` (Only allows removal of the quoted message.) |\n| `allowMissing` | `boolean` Optional. If `true` and the message isn't found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) or the request fails. |\n\n### Request body\n\nThe request body contains an instance of [Message](/workspace/chat/api/reference/rest/v1/spaces.messages#Message).\n\n### Response body\n\nIf successful, the response body contains an instance of [Message](/workspace/chat/api/reference/rest/v1/spaces.messages#Message).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.bot`\n- `https://www.googleapis.com/auth/chat.import`\n- `https://www.googleapis.com/auth/chat.messages`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]