Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Need some assistance using Alteryx and Google webhook to message an existing thread.

AkisM
10 - Fireball

So far I've managed to successfully send google chat messages to specific chatrooms using the google webhook URL. I'm sharing below a setup of my current workflow that successfully does that. What I haven't managed to do is send the message to a specific thread, instead of a new one being created automatically each time (which is the current default behavior of my workflow)

 

Let's say the thread key of the thread I want the message to go to is 1eFXoWDA5bs

Based on another post afound, and on google's documentation here https://developers.google.com/chat/how-tos/webhooks#reply_to_a_message_thread

I tried adjusting just the URL value of my setup to the following values:

1. https://chat.googleapis.com/v1/spaces/AAAAs4vUeDk/messages?threadKey=1eFXoWDA5bs

Response: Missing valid API key

2. https://chat.googleapis.com/v1/spaces/AAAAs4vUeDk/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqs...

Response: Invalid request token

3. https://chat.googleapis.com/v1/spaces/AAAAs4vUeDk/messages?key=1eFXoWDA5bs

Response: API key not valid. Please pass a valid API key.

 

I already came across cgoodman3's response in a similar thread (https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Google-Chat-webhooks-via-download-tool...), but I still wasn't able to figure it out unfortunately

 

As I am not very experienced with the download tool and API requests yet, could someone suggest an edit that achieves the above? Thanks in advance.

 

EDIT:

The correct format of the URL for sending a message to a specific thread is:

https://chat.googleapis.com/v1/spaces/AAAAs4vUeDk/messages?threadKey=txhGSGk1H-c&key=AIzaSyDdI0hCZtE...

 

So the threadkey parameter has to be first, followed by key and token. However, now I'm still stuck at the part where I need to figure out how to get a list of all threads in a specific space, in order to find the latest thread to send the message to. Any ideas?

1 REPLY 1
milos_bijelic
Alteryx
Alteryx

Hey @AkisM , 

 

If you want to post a message to a Google Chat Thread you'll need the Thread Identifier. Inside every Google Message, you can find the thread ID. More specifically, inside the REST Resource spaces.message. Here's some more info on that

 

What you'll need to do, is pull a Google Chat Message from the thread your interested in. You can do this using the spaces.messages.get function

 

To sum all of this up - 
Step 1. Get Google Chat Message Response from the thread of interest

Step 2. Parse the JSON response and pull out the thread: value

Step 3. Pass this thread: value into your current API call

 

Hope this helps, 
Milos

Labels
Top Solution Authors