Search code examples
google-chat

How do you respond to a thread in Google Chat from an incoming webhook?


There's a thread that my webhook has previously created that it wants to reply to. Is this possible using a webhook? It seems to be possible with a bot, see this answer:

https://stackoverflow.com/a/58657945/3832377

But I can't find any documentation on doing it from a webhook. As I've created the original message in the thread, I can guarentee a consistent threadId.

I tried to send a body that looked like:

{
  "cards": [/* a card */]
  "thread": { "name": "some_thread_name" }
}

But received a 500 error.


Solution

  • Documentation: https://developers.google.com/hangouts/chat/reference/rest/v1/spaces.messages/create

    States you have to add the threadKey as a query parameter, not in the request body.