ทำให้ผู้ใช้บางรายในองค์กร Google Workspace ค้นพบพื้นที่ใน Google Chat ได้
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หน้านี้อธิบายวิธีใช้ Google Chat API เพื่อแชร์พื้นที่ทำงานใน Google Chat
กับผู้ใช้ที่เฉพาะเจาะจงในองค์กร Google Workspace เพื่อให้ผู้ใช้เหล่านั้น
ค้นพบและเข้าร่วมพื้นที่ทำงานได้
หากต้องการระบุผู้ใช้ในองค์กรที่ค้นพบและเข้าร่วมพื้นที่ทำงานได้
คุณต้องสร้างกลุ่มเป้าหมาย กลุ่มเป้าหมายคือกลุ่มคน เช่น
แผนกที่เฉพาะเจาะจงหรือทั้งองค์กรที่คุณแชร์พื้นที่ทำงาน
ใน Chat ด้วยได้ เพื่อเพิ่มการรับรู้และความสามารถในการแชร์ของพื้นที่ทำงาน นอกจากนี้ กลุ่มเป้าหมายยังช่วยให้คุณจัดการและปรับแต่งการเป็นสมาชิกของพื้นที่ทำงานได้โดยไม่ต้องเชิญผู้ใช้แต่ละรายไปยังพื้นที่ทำงาน ดูข้อมูลเพิ่มเติมได้ที่เกี่ยวกับกลุ่มเป้าหมาย
คุณจะทำให้พื้นที่ทำงานที่มีชื่อค้นพบได้เฉพาะกลุ่มเป้าหมายเท่านั้น คุณไม่สามารถแชร์พื้นที่ทำงานประเภทอื่นๆ เช่น ข้อความส่วนตัวหรือการสนทนากลุ่ม กับกลุ่มเป้าหมายได้
ข้อกำหนดเบื้องต้น
รับรหัสกลุ่มเป้าหมาย
หากต้องการรับรหัสของกลุ่มเป้าหมาย ให้ทำดังนี้
ในคอนโซลผู้ดูแลระบบของ Google ให้ไปที่
เมนู menu
> ไดเรกทอรี
> กลุ่มเป้าหมาย
ไปที่กลุ่มเป้าหมาย
ในตารางกลุ่มเป้าหมาย ให้คลิกช่องชื่อของกลุ่มเป้าหมาย
ค้นหารหัสกลุ่มเป้าหมายใน URL ของหน้าเว็บ รูปแบบ URL คือ
https://admin.google.com/ac/targetaudiences/TARGET_AUDIENCE_ID
โดยที่ TARGET_AUDIENCE_ID
คือรหัสตัวอักษรและตัวเลขสำหรับ
กลุ่มเป้าหมาย
ในส่วนถัดไป คุณจะใช้รหัสกลุ่มเป้าหมายเพื่อสร้าง
พื้นที่ที่ค้นพบได้ หรืออัปเดตพื้นที่ที่มีอยู่ให้กลุ่มเป้าหมาย
ค้นพบได้
ระบุกลุ่มเป้าหมายในคำขอ Chat API
หากต้องการสร้างพื้นที่ทำงานสำหรับกลุ่มเป้าหมายที่เฉพาะเจาะจง ให้ใช้วิธี create()
หรือ
setup()
ในทรัพยากร Space
หากต้องการทำให้พื้นที่ทำงานที่มีอยู่
ค้นพบได้ ให้ใช้วิธี update()
กับทรัพยากร Space
เนื่องจากแชร์ได้เฉพาะพื้นที่ทำงานที่มีชื่อกับกลุ่มเป้าหมายเป้าหมาย ประเภทพื้นที่ทำงาน (แสดงในช่อง spaceType
) จึงต้องเป็น SPACE
หากต้องการทำให้กลุ่มเป้าหมายค้นพบพื้นที่ทำงานได้ ให้รวมออบเจ็กต์
AccessSettings
ในทรัพยากร Space
เป็นส่วนหนึ่งของคำขอ Chat API ใน
ออบเจ็กต์ ให้ระบุฟิลด์ audience
ดังนี้
"accessSettings": {
"audience": "audiences/TARGET_AUDIENCE_ID"
}
แทนที่ TARGET_AUDIENCE_ID
ด้วยรหัสของกลุ่มเป้าหมาย
ที่คุณได้รับในส่วนก่อนหน้า หากต้องการใช้การตั้งค่าการแชร์พื้นที่ทำงาน Chat เริ่มต้นสำหรับองค์กร Google Workspace ให้แทนที่ด้วย default
ดูรายละเอียดเกี่ยวกับการสร้างหรืออัปเดตพื้นที่ทำงานโดยใช้ Chat API ได้ในคำแนะนำต่อไปนี้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-04 UTC
[null,null,["อัปเดตล่าสุด 2025-08-04 UTC"],[[["\u003cp\u003eThis page guides Google Workspace admins on how to use the Google Chat API to share named spaces with specific users within their organization.\u003c/p\u003e\n"],["\u003cp\u003eTarget audiences are used to control which users can discover and join a space, replacing the need to invite individuals.\u003c/p\u003e\n"],["\u003cp\u003eTo share a space, the \u003ccode\u003eAccessSettings\u003c/code\u003e object in the Chat API request should contain the target audience ID within the \u003ccode\u003eaudience\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003ePrerequisites include a Business or Enterprise Google Workspace account with super admin privileges, an available target audience, and user authentication when calling the Chat API.\u003c/p\u003e\n"],["\u003cp\u003eAdmins can get the target audience ID from the Google Admin console under Directory > Target Audiences, then locate it within the URL of the specific target audience page.\u003c/p\u003e\n"]]],["The core content details sharing Google Chat spaces with specific users within a Google Workspace organization using the Google Chat API. It focuses on creating or updating spaces to be discoverable to target audiences—groups of users like departments or the entire organization. To achieve this, users must obtain a target audience ID from the Google Admin console and include it in the API request's `AccessSettings` object when creating or updating a named space. This makes the space discoverable and allows customized memberships.\n"],null,["# Make a Google Chat space discoverable to specific users in a Google Workspace organization\n\nThis page explains how to use the Google Chat API to share a Google Chat space\nwith specific users in a Google Workspace organization, so that they can\ndiscover and join the space.\n\nTo specify the users in your organization that can discover and join a space,\nyou create target audiences. A *target audience* is a group of people---such as\nspecific departments or the entire organization---that you can share a\nChat space with, to improve the space's awareness and\nshareability. Target audiences also let you manage and customize space\nmemberships rather than needing to invite individual users to a space. For more\ninformation, see [About target\naudiences](https://support.google.com/a/answer/9934697).\n\nYou can only make named spaces discoverable to target audiences. You can't\nshare other space types, such as direct messages or group conversations, with\ntarget audiences.\n\nPrerequisites\n-------------\n\n- A Business or Enterprise [Google Workspace](https://support.google.com/a/answer/6043576) account with access to [Google Chat](https://workspace.google.com/products/chat/). Your account must have the [super administrator\n role](https://support.google.com/a/answer/2405986?sjid=1448018578843125834-NC#super_admin) for your Google Workspace organization.\n- A target audience that's available for access in Chat. To create a target audience, see [Create a target\n audience](https://support.google.com/a/answer/9935192). To make an existing target audience available to Chat spaces, see [Set up space access for Chat](https://support.google.com/a/answer/12129901).\n- You must call Google Chat API, with [user authentication](/workspace/chat/authenticate-authorize-chat-user).\n\nGet the target audience ID\n--------------------------\n\nTo get the ID of a target audience, do the following:\n\n1. In the Google Admin console, go to\n **Menu menu\n \\\u003e Directory\n \\\u003e Target audiences**.\n\n [Go to Target audiences](https://admin.google.com/ac/targetaudiences)\n2. In the **Target audiences** table, click the **Name** field of the target\n audience.\n\n3. Find the target audience ID in the URL for the page. The URL format is\n `https://admin.google.com/ac/targetaudiences/`\u003cvar translate=\"no\"\u003eTARGET_AUDIENCE_ID\u003c/var\u003e,\n where \u003cvar translate=\"no\"\u003eTARGET_AUDIENCE_ID\u003c/var\u003e is the alphanumeric ID for\n your target audience.\n\nIn the next section, you use the target audience ID to either create a\ndiscoverable space or update an existing space to make it discoverable to the\ntarget audience.\n\nSpecify the target audience in your Chat API request\n----------------------------------------------------\n\nTo create a space for a specific target audience, use the [`create()`](/workspace/chat/api/reference/rest/v1/spaces/create) or\n[`setup()`](/workspace/chat/api/reference/rest/v1/spaces/setup) method on the `Space` resource. To make an existing space\ndiscoverable, use the [`update()`](/workspace/chat/api/reference/rest/v1/spaces/patch) method on the `Space` resource. Because only\nnamed spaces can be shared with target audiences, the space type\n(represented in the `spaceType` field) must be `SPACE`.\n\nTo make a space discoverable to your target audience, include the\n[`AccessSettings`](/workspace/chat/api/reference/rest/v1/spaces#accesssettings)\nobject in the `Space` resource as part of your Chat API request. In\nthe object, specify `audience` field: \n\n \"accessSettings\": {\n \"audience\": \"audiences/\u003cvar translate=\"no\"\u003eTARGET_AUDIENCE_ID\u003c/var\u003e\"\n }\n\nReplace \u003cvar translate=\"no\"\u003eTARGET_AUDIENCE_ID\u003c/var\u003e with the ID of the target\naudience that you obtained in the previous section. To use the default\nChat space share settings for your Google Workspace\norganization, replace with `default`.\n\nFor details on creating or updating spaces using the Chat API, see the\nfollowing guides:\n\n- [Create a space](/workspace/chat/create-spaces)\n- [Set up a space](/workspace/chat/set-up-spaces)\n- [Update a space](/workspace/chat/update-spaces)\n\nRelated topics\n--------------\n\n- [Create a target audience](https://support.google.com/a/answer/9935192)\n- [Set up sharing in Chat](https://support.google.com/a/answer/12129901)\n- [Create spaces with different access levels](https://support.google.com/chat/answer/11971020)"]]