求助:寻找Hangouts Chat创建房间的REST API端点
Hey there, I’ve run into this exact confusion before, so let me break it down clearly for you:
First off, the original Hangouts Chat REST API does NOT have an official endpoint to create rooms directly — this is a known limitation that frustrated a lot of us back when it was active. But here’s the key update: Google has phased out Hangouts Chat in favor of Google Chat, which does offer full API support for creating spaces (the modern equivalent of Hangouts Chat rooms).
替代方案:使用Google Chat API创建空间
If you’re working within a Google Workspace environment (which is the supported path now), you can use the Google Chat API’s spaces.create endpoint to create a room-like space. Here’s what you need to know:
- Required Permissions: You’ll need the
chat.spaces.createOAuth scope (or if using a service account, enable Domain-Wide Delegation for this scope). - Example Request (cURL):
curl -X POST "https://chat.googleapis.com/v1/spaces" \ -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Project Kickoff Room", "spaceType": "ROOM" # Use "GROUP_CHAT" for smaller ad-hoc chats, "DIRECT_MESSAGE" for 1:1 }' - Response: The API will return a
Spaceobject with details like the space name, ID, and link to access it.
如果你必须使用旧版Hangouts Chat
Unfortunately, there’s no official REST API way to create rooms here. Your only options would be:
- Using client-side automation (like Selenium) to simulate user actions, but this is unsupported and prone to breakage as Google updates the interface.
- Checking if your use case can be handled by Google Chat instead — since Hangouts Chat is being retired, migrating is the long-term sustainable path.
Hope this clears things up and gets you unblocked!
内容的提问来源于stack exchange,提问作者sarbada

