google-hangoutshangouts-api

Cannot message bot due to 'Your administrator prevented you from talking to bots in direct messages'


We have a simple hangouts bot that has been working fine for several months. Starting yesterday 1 or 2 users indicated that they were receiving an error message when talking to the bot indicating that: 'Your administrator prevented you from talking to bots in direct messages'. Over the past 24-hours more and more people reported that the issue started happening to them until it was everyone. When it happened to me earlier today I messaged the bot 2 times about 5-minutes apart, it worked the first time then the second time I got the administrator prevented message.

I tested the @meet and @drive bot's and they both still appear to work.

I have confirmed that none of the settings on the bot have changed, most importantly that the 'Bot works in direct messages' option is still checked.

I have talked to our IT administrator who says that no settings have changed in our GSuite setup.

Looking through the documentation I can't find any mention of an issue or setting that would cause the above error. Is anyone aware of what could be causing the above.


Solution

  • Google Support statement

    (...) if your domain currently applies a whitelist to restrict the set of G Suite Marketplace apps that users can install, existing internal bots may stop working. In order to appear and continue to function for users, the developers of these bots need to publish the bots to the domain as you can see on link. (...)

    Solution

    As said Jordansan this issue is related to the domain administration and to security enhancements. You may still use up to 5 email addresses to do your tests. Once you want your bot public, you will need to list it on the G Suite Marketplace.

    To do so follow this guide Listing your bot on G Suite Marketplace. An extract is provided below :

    G Suite Marketplace publication steps

    This section tells you the specific steps you need to perform to publish your bot on G Suite Marketplace. The general steps are:

    1. Create an OAuth client ID, if your project doesn't already have one.
    2. Add the G Suite Marketplace SDK to your project and populate its configuration tab.
    3. Populate the SDK's publish tab and submit.

    The detailed steps for each of these are described in the following paragraphs.

    For security reasons most organizations have (and should have) whitelisting enabled, which will prevent non white-listed marketplace apps to be enabled within the organization.

    To deploy your bot you'll need to contact your GCP responsible and ask him to whitelist your bot.

    Temporary solutions

    What you can do is make the bot accessible to everyone in your organization. Assuming that the bot can be published.

    If the bot shouldn't be public, you may implement your own connector to filter incoming queries and allow only selected email addresses. However the bot will still appear to everyone on the search screen, and everyone will be able to message it.