Search code examples
webhooksgoogle-hangouts

How to send a DM to google chat via API using email or phone number


I need to create a solution for my company where we need to be able to send a DM from an existing application to an organization member google chat.

Ideally we would make a POST to an google chat API providing the user email or phone number (data we already own) to send the message, or make a request to an API where we could provide the email or phone number and retrieve the incoming webhook url for that user and then use that to send the message.

All answers I've read so far point to a user initiated process, such as interacting with a bot, which usually have low adoption.

Is there another way to achieve a low friction solution?

Thanks a lot!


Solution

  • All messages to Google Chat from third-party applications are passed through incoming webhooks, which are contained within bots. Bots can be configured in a group chat in such a way that there is no need for user interaction. And then you can use the REST API in your external application to create the message to the configured bot, and the bot will automatically forward the message to Google Chat.

    enter image description here

    More material can be found here:

    Using Incoming Webhooks

    Connect to External Webapps