I have developed a HTTPS Synchronous end point that responds to POST messages and configured the URL as "Bot URL" under Chat bot configuration for Hangouts Chat. It is deployed to an EC2 in amazon aws and added a route53 entry for the URL: https://mychatbot-implementation which redirects HTTPS POSTs to my ec2.
However, chat bot is not posting any messages to the https end point and there are no errors logged.
Link to screenshot of chat-bot configuration
Chat Bot Implementation Code Here:
from flask import Flask, request, json, render_template, make_response
app = Flask(__name__)
@app.route('/', methods=['POST'])
def on_event():
event = request.get_json()
resp = None
if event['type'] == 'REMOVED_FROM_SPACE':
logging.info('Bot removed from space...')
if event['type'] == 'ADDED_TO_SPACE':
text = 'Thanks for adding me to "%s"!' % event['space']['displayName']
elif event['type'] == 'MESSAGE':
text = 'You said: `%s`' % event['message']['text']
else:
return
return json.jsonify({'text': text})
if __name__ == '__main__':
app.run(port=8080, ssl_context='adhoc', debug=True, host='my host ip address')
Could someone please advise on the next steps?