I have the following google cloud function:
def run_msg(event, context):
print(event["data"])
url = 'google_chat_hook'
bot_message = {
'text' : '{}'.format(event["data"])}
message_headers = { 'Content-Type': 'application/json; charset=UTF-8'}
http_obj = Http()
response = http_obj.request(
uri=url,
method='POST',
headers=message_headers,
body=dumps(bot_message),
)
When I'm testing the function directly from the Cloud Function Interface with the following trigger event {"data": {"message": "test"}}
I have the right message being published in google chat => {"message": "test"}
but when I'm publishing a message from pub sub manually I have the following kind of stuff being posted on google chat iB7Im1lc3NhZ2UiOiAibXNnX2Nvb2wifX
I can't understand what's happening here.