Method: spaces.create
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
একটি স্থান তৈরি করে। একটি নামযুক্ত স্থান, বা Import mode
একটি গ্রুপ চ্যাট তৈরি করতে ব্যবহার করা যেতে পারে৷ একটি উদাহরণের জন্য, একটি স্থান তৈরি করুন দেখুন।
নিম্নলিখিত ধরনের প্রমাণীকরণ সমর্থন করে:
একটি অ্যাপ হিসেবে প্রমাণীকরণ করার সময়, অনুরোধে space.customer
ক্ষেত্রটি অবশ্যই সেট করতে হবে।
একটি অ্যাপ হিসাবে প্রমাণীকরণ করার সময়, চ্যাট অ্যাপটি স্থানের সদস্য হিসাবে যোগ করা হয়। যাইহোক, মানুষের প্রমাণীকরণের বিপরীতে, চ্যাট অ্যাপটি স্পেস ম্যানেজার হিসাবে যোগ করা হয় না। ডিফল্টরূপে, সমস্ত স্পেস সদস্যরা স্পেস থেকে চ্যাট অ্যাপটি সরাতে পারেন। শুধুমাত্র স্পেস ম্যানেজারদের একটি স্পেস থেকে অ্যাপটি সরানোর অনুমতি দিতে, space.permission_settings.manage_apps
এ managersAllowed
সেট করুন।
স্পেস মেম্বারশিপ তৈরির উপর নির্ভর করে যে স্পেসটি Import mode
তৈরি করা হয়েছে কিনা:
- আমদানি মোড: কোনো সদস্য তৈরি করা হয় না।
- অন্যান্য সমস্ত মোড: কলিং ব্যবহারকারীকে সদস্য হিসাবে যুক্ত করা হয়। এটি হল:
- অ্যাপ প্রমাণীকরণ ব্যবহার করার সময় অ্যাপ নিজেই।
- ব্যবহারকারী প্রমাণীকরণ ব্যবহার করার সময় মানব ব্যবহারকারী।
যদি আপনি একটি স্পেস তৈরি করার সময় ALREADY_EXISTS
ত্রুটি বার্তাটি পান, একটি ভিন্ন displayName
চেষ্টা করুন। Google Workspace সংস্থার মধ্যে আগে থেকেই এই ডিসপ্লে নাম ব্যবহার করা হতে পারে।
HTTP অনুরোধ
POST https://chat.googleapis.com/v1/spaces
URL gRPC ট্রান্সকোডিং সিনট্যাক্স ব্যবহার করে।
ক্যোয়ারী প্যারামিটার
পরামিতি |
---|
requestId | string ঐচ্ছিক। এই অনুরোধের জন্য একটি অনন্য শনাক্তকারী। একটি র্যান্ডম UUID সুপারিশ করা হয়. একটি বিদ্যমান অনুরোধ আইডি নির্দিষ্ট করা একটি নতুন স্থান তৈরি করার পরিবর্তে সেই আইডি দিয়ে তৈরি স্থান ফেরত দেয়। একটি ভিন্ন প্রমাণীকৃত ব্যবহারকারীর সাথে একই চ্যাট অ্যাপ থেকে একটি বিদ্যমান অনুরোধ আইডি নির্দিষ্ট করা একটি ত্রুটি ফেরত দেয়। |
শরীরের অনুরোধ
অনুরোধের মূল অংশে Space
একটি উদাহরণ রয়েছে।
প্রতিক্রিয়া শরীর
সফল হলে, রেসপন্স বডিতে Space
এর একটি নতুন তৈরি উদাহরণ থাকে।
অনুমোদনের সুযোগ
নিম্নলিখিত OAuth সুযোগগুলির মধ্যে একটি প্রয়োজন:
-
https://www.googleapis.com/auth/chat.app.spaces.create
-
https://www.googleapis.com/auth/chat.app.spaces
-
https://www.googleapis.com/auth/chat.import
-
https://www.googleapis.com/auth/chat.spaces
-
https://www.googleapis.com/auth/chat.spaces.create
আরও তথ্যের জন্য, অনুমোদন নির্দেশিকা দেখুন।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eCreates a space in Google Chat, which can be a named space or a group chat, supporting app and user authentication.\u003c/p\u003e\n"],["\u003cp\u003eWhen using app authentication, the space.customer field is required and no members are added in Import mode; otherwise, the calling user becomes a member.\u003c/p\u003e\n"],["\u003cp\u003eUses the \u003ccode\u003ePOST https://chat.googleapis.com/v1/spaces\u003c/code\u003e HTTP request to create a space and requires specific OAuth scopes for authorization.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should contain a Space object and the response, if successful, will contain the newly created Space object.\u003c/p\u003e\n"],["\u003cp\u003eIf the displayName already exists, an \u003ccode\u003eALREADY_EXISTS\u003c/code\u003e error will be returned, suggesting to try a different displayName.\u003c/p\u003e\n"]]],["This content outlines how to create a space using the Chat API. Key actions include sending a `POST` request to `https://chat.googleapis.com/v1/spaces`. The request may include a unique `requestId` and must contain a `Space` instance in the body. Authentication can be app-based or user-based, requiring specific OAuth scopes. Space membership varies by import mode; no members in import mode, otherwise the caller is added. Response will contain new space information.\n"],null,["# Method: spaces.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\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\nCreates a space. Can be used to create a named space, or a group chat in `Import mode`. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces).\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 [administrator approval](https://support.google.com/a?p=chat-app-auth) and one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.app.spaces.create`\n - `https://www.googleapis.com/auth/chat.app.spaces`\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.spaces.create`\n - `https://www.googleapis.com/auth/chat.spaces`\n - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)\n\nWhen authenticating as an app, the `space.customer` field must be set in the request.\n\nWhen authenticating as an app, the Chat app is added as a member of the space. However, unlike human authentication, the Chat app is not added as a space manager. By default, the Chat app can be removed from the space by all space members. To allow only space managers to remove the app from a space, set `space.permission_settings.manage_apps` to `managersAllowed`.\n\nSpace membership upon creation depends on whether the space is created in `Import mode`:\n\n- **Import mode:** No members are created.\n- **All other modes:** The calling user is added as a member. This is:\n - The app itself when using app authentication.\n - The human user when using user authentication.\n\nIf you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.\n\n### HTTP request\n\n`POST https://chat.googleapis.com/v1/spaces`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestId` | `string` Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. |\n\n### Request body\n\nThe request body contains an instance of [Space](/workspace/chat/api/reference/rest/v1/spaces#Space).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Space](/workspace/chat/api/reference/rest/v1/spaces#Space).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.app.spaces.create`\n- `https://www.googleapis.com/auth/chat.app.spaces`\n- `https://www.googleapis.com/auth/chat.import`\n- `https://www.googleapis.com/auth/chat.spaces`\n- `https://www.googleapis.com/auth/chat.spaces.create`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]