Rasa Integration with Google hangouts


I am trying to connect Google Hangouts chat with my local rasa bot using Ngrok. I followed the guideline that is published on Rasa.

So, I added hangouts API with the correct local https link and add the Project ID from google in credentials.yml.

After completing the guideline, I get the following error in the Ngrok inspect environment.

Following the exact guideline for Facebook Messenger does work though.

Is there anyone that is familiar with this error or knows how to figure out where the problem is?

Hi @Juste,

Can you help me?

Hey @younessegh

Do you have an access to the log messages from the Rasa?

Hey @degiz,

Do you mean this log message?

    Exception occurred while handling uri: 'http://d3689136.ngrok.io/webhooks/hangouts/webhook'
    Traceback (most recent call last):
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/sanic/app.py", line 976, in handle_request
        response = await response
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/rasa/core/channels/hangouts.py", line 280, in receive
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/rasa/core/channels/hangouts.py", line 257, in _check_token
        bot_token, self.project_id, cert_uri=CERT_URI,
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
        return wrapped(*args, **kwargs)
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/oauth2client/client.py", line 1556, in verify_id_token
        resp, content = transport.request(http, cert_uri)
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/oauth2client/transport.py", line 282, in request
      File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/httplib2/__init__.py", line 1794, in request
        (scheme, authority, request_uri, defrag_uri) = urlnorm(uri)
  File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/httplib2/__init__.py", line 241, in urlnorm
    (scheme, authority, path, query, fragment) = parse_uri(uri)
  File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/httplib2/__init__.py", line 236, in parse_uri
    groups = URI.match(uri).groups()
TypeError: expected string or bytes-like object
Traceback (most recent call last):
  File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/sanic/app.py", line 940, in handle_request
handler, args, kwargs, uri, name = self.router.get(request)
  File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/sanic/router.py", line 411, in get
return self._get(request.path, request.method, "")
  File "/Users/younes/.virtualenvs/Rasa-jvkE_tUm/lib/python3.6/site-packages/sanic/router.py", line 452, in _get
raise method_not_supported
sanic.exceptions.MethodNotSupported: Method GET not allowed for URL /webhooks/hangouts/webhook

Hey @younessegh

Do you mean this log message?

Yes, precisely.

sanic.exceptions.MethodNotSupported: Method GET not allowed for URL /webhooks/hangouts/webhook

Looks like something is wrong with the configuration. Could you please share your credentials.yml?

Hi @degiz,

The problem is solved. I had to do two changes.

  1. Change the Project ID in credentials to to the Project number that was given by google.
  2. Change in the CERT_URI = “https://www.googleapis.com/service_accounts/v1/metadata/x509/chat@system.gserviceaccount.com” in hangouts.py. It was a tuple type, but changed it to a string
1 Like

Hey @younessegh

Great that you have it working!

If you made some changes in the hangouts.py maybe you can consider opening a PR so that it will be fixed for everyone then?

Hey @younessegh i was also looking to integrate my bot in hangouts.Can you please explain how did you proceed as i am not able to understand the documentation provided by rasa.Any help will be appreciated.

Hi @eashan_27,

I am happy to help you. What have you done so far and what part of the documentation of Rasa don’t you understand?

Thanls for replying @younessegh.I wanted to ask you how to integrate rasa with hangouts?Can you explain the steps for doing that as i am not getting how to connect both hangouts and rasa.

@eashan_27 Please note which part of the Google Hangouts Chat you don’t understand. It is a lot to explain all the steps by myself


I hope this finds someone who can help with this issue. I’m investigating rasa and would love to integrate it with hangouts. However, the current documentation at Google Hangouts Chat seems to assume great prior knowledge in integrating rasa with external channels.

I belive that this documentation could point out to parts of the Hangouts API where my rasa server would be called. So far, this documentations seems to indicate just the mention of project id in the credentials.yml. However, examples of calls to rasa server in the Hangouts API would greatly clarify how this integration should work.