GET https://chat.googleapis.com/v1/{name=spaces/*}
Example: spaces/AAAAMpdlehY
From where I can check my space name.
Any help would be much appreciated!
GET https://chat.googleapis.com/v1/{name=spaces/*}
Example: spaces/AAAAMpdlehY
From where I can check my space name.
Any help would be much appreciated!
Space is the chat room, it has the following properties:
{
"name": string,
"type": enum (Type),
"displayName": string
}
Sample:
"spaces": [
{
"name": "spaces/1qI6WgAAAAE",
"type": "DM",
"displayName": ""
},
{
"name": "spaces/AAAAA-kdsi4",
"type": "ROOM",
"displayName": "test room"
},
]
ROOM
are the ones you created and they have the displayName
that you assigned to them.DM
are chatrooms between a user and a bot, they do not have a display name and appear in the user interface of https://chat.google.com/
as conversations under the section BOTS
name
is a parameter that gets assigned to a space in the background when it gets created.The easiest way is to write a function onMessage()
and retrieve the details of the room where a message was sent as an event object.
Apps Script sample:
function onMessage(event) {
var name = event.space.name;
var displayName = event.space.displayName;
Logger.log(name);
Logger.log(displayName);
}
The Space Name is an unique identifier for a conversation.
Space is of two types:
Room
Direct Message
Any Information regarding a room or a Direct Message can be got only using Space Name.
The Space Name can be found in the Last part of the URL. For Example: chat.google.com/room/AABBCCxh8
Here AABBCCxh8
is the Space Name.