Get details about a space (original) (raw)

This guide explains how to use theget()method on a Space resource of the Google Chat API to see details about a space, like its display name, description, and guidelines.

If you're a Google Workspace administrator, you can call the get() method to retrieve details about any space in your Google Workspace organization.

TheSpace resourcerepresents a place where people and Chat apps can send messages, share files, and collaborate. There are several types of spaces:

Authenticating withapp authenticationlets a Chat app get details about a space where the Chat app is a member. Authenticating withuser authenticationlets you get spaces that the authenticated user has access to, either as a space member or aGoogle Workspace administrator.

Prerequisites

Node.js

Python

Java

Apps Script

To get a space in Google Chat, pass the following in your request:

Get space details as a user

Here's how to get space details withuser authentication:

Node.js

Python

Java

Apps Script

To run this sample, replace SPACE_NAME with the ID from the space'snamefield. You can obtain the ID by calling theListSpaces()method or from the space's URL.

The Chat API returns an instance ofSpacethat details the specified space.

Get space details as a Google Workspace administrator

If you're a Google Workspace administrator, you can call the GetSpacemethod to retrieve details about any space in your Google Workspace organization.

To call this method as a Google Workspace administrator, do the following:

For more information and examples, seeManage Google Chat spaces as a Google Workspace administrator.

Get space details as a Chat app

Here's how to get space details withapp authentication:

Node.js

Python

Java

Apps Script

To run this sample, replace SPACE_NAME with the ID from the space'snamefield. You can obtain the ID by calling theListSpaces()method or from the space's URL.

The Chat API returns an instance ofSpacethat details the specified space.

Limitations and considerations