Additional authorizing in Google App script to run google chat

Viewed 50

I've created chat bot, and it's work, but after adding my bot to chat i had to configure and authorization it. It's clear, but i had to run script as well manually to get more authorization, without it i don't have access to my bot's functionality. How can I resolve that problem, so that another users of this chat didn't have to run script manually to get access to use chat bot ?

1 Answers

I made a chatbot as a test, and it's working without running the Apps Script. Here are the steps that I followed (You can review them and see if one of those helps you):

  1. Create the Chatbot, run it once manually to allow the permissions, and deploy it as an add-on. Save the deployment ID somewhere since you will use it in step 9.

enter image description here

enter image description here

  1. Create a new project inside the Google Cloud console.
  2. Copy the Google Cloud project number, and save it somewhere since you will use it in step 5.
  3. Set a consent screen. (Mainly because you will get an error when you try to add the project without it. If you like you can add the scopes of chat but is not a requirement)

enter image description here

  1. Set the Apps Script project's Google Cloud project.

enter image description here

enter image description here

  1. Enable the Chat API.

enter image description here

enter image description here

  1. Click configuration, after adding the Chat API.

enter image description here

  1. Add all the required information there, including the Apps Script project deployment ID; and if the chatbot will be available for the entire domain or just a group of people.

  2. Save the changes. After that, I subscribed to both with another account without issues and without being requested to run the bot.

enter image description here

Reference

Related