0

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!

Dale K
  • 25,246
  • 15
  • 42
  • 71

2 Answers2

1

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"
    },
  ]
  • The spaces of the type ROOM are the ones you created and they have the displayName that you assigned to them.
  • The spaces of the type 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.

How to retrieve space names?

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);
}
  • If you want to list all spaces independently of an event, you need to use the method spaces:list.
  • Mind that this can only be done with a service account.
ziganotschka
  • 25,866
  • 2
  • 16
  • 33
0

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.

Community
  • 1
  • 1