1

Case: Google Chat support in node.js using the googleapis library.

I studied the documentation, created a service account and implemented authentication. In first step I used the chat.spaces.list() method and it worked (no error returned).

I want to send a message via chat, so I wanted to create a new space, I found the chat.spaces.create method (https://developers.google.com/chat/api/reference/rest/v1/spaces/create) Unfortunately, this method is not present in "googleapis" for node.js In general, I see that the list of methods in "googleapis" is different than the one in the documentation. Only spaces in the documentation, but spaces and rooms in the library... I'm lost. How to do it? Any tips?

ehmh ehmh
  • 17
  • 1

1 Answers1

0

I see that the list of methods in "googleapis" is different than the one in the documentation

I think you are seeing wrong documentation. Your reference link is REST API documentation. The nodejs googleapis client documentation you can see on https://googleapis.dev/nodejs/googleapis/latest/chat/classes/Resource$Spaces.html.

And also based on the REST API documentation, the API that you looking for(create space) is not general available.

† Supports user authentication in Developer Preview. App authentication isn't available.

You need to join Google Workspace Developer Preview Program to access that feature.

Muhammad Dyas Yaskur
  • 6,914
  • 10
  • 48
  • 73
  • This is documentation created based on library code (automatically, not by human). The raw description of the parameters is easier to read in the code - IMHO it's completely useless. The library is a few years old, so I don't think it's impossible to simple send a message via chat. I guess I have to look for another way, maybe I focused on "space" unnecessarily.Anyway, thank you for your answer/tip. – ehmh ehmh Feb 13 '23 at 12:46
  • @ehmhehmh your question is about create space/room, so it's impossible at yet(without early access), if you just want to send simple message it's possible using current chat API or webhook. Maybe you can update your question, and I will also update my answer. Or you can create a new question also. – Muhammad Dyas Yaskur Feb 13 '23 at 20:39