0

I am looking to implement a hangouts chat bot for my customers. I am fairly new to the Google ecosystem, so I apologize in advance if some of this is obvious.

Here is my basic confusion:

  • It looks like in order to access the REST api the chat api requires a service account.
  • Does this mean that I will have to ask every customer to create a service account using their Google cloud account?
    • Corollary to the above is: Does every GSuite account have a Google cloud platform account associated with it?
  • If the service account has to be created, would the customer somehow need to share the private key for that account with me in order for my application to make calls on behalf of the service account.

My end goal is to give my customers a seamless experience where they can choose to

  • Install my bot in the Google Chat app for their GSuite domain
  • At the time of install get some information about their domain
  • Whenever a message is sent to the bot (DM or Room), identify who the message is coming for and in which GSuite domain, and reply accordingly.

Is this possible? Am I missing some very obvious Google concepts?

Thanks in advance.

  • 1
    It is possible, you have to create one service account and provide domain level delegation with all possible access rights your Chatbot may need. I will add detailed answer tomorrow. This is just for quick support – Darpan Sanghavi Apr 26 '20 at 06:04

2 Answers2

0

If your customers have a normal email they can't connect with you. For more information refer this link

Sabesan
  • 654
  • 1
  • 10
  • 17
0

Considerations

The service account is used from your bot to access the Google REST APIs. It has a service account for your Google Cloud Project. There is no need for every user to have an service account enabled nor for them to give your their private key (never share private keys).

Approach

You can build and deploy Google Chat Bots directly using Google Apps Script. For your application I suggest you to use the tutorial in this page: https://developers.google.com/hangouts/chat/quickstart/apps-script-bot

Reference

Creating new Bots

Alessandro
  • 2,848
  • 1
  • 8
  • 16