Webhook in Node.js (on Google Cloud Function)

google

#1

We would like to use Google Cloud Functions to respond to Asana webhooks. Any examples on how to create a webhook in Node.js?


#2

Hi @Jann_Krynauw! You can find an example of a node app that creates a webhook and prints out events here: https://glitch.com/edit/#!/asana-webhooks

Hope that helps!


#3

Thank you @DearDaniel , this is useful.

Google Cloud Functions creates an endpoint in the form https://YOUR_REGION-YOUR_PROJECT_ID.cloudfunctions.net/FUNCTION_NAME which could process the data from a POST request.

Looking at the above link I see that the application created webhooks based on this payload:
{ data: { resource: '707210418342227', target: 'https://some-text.glitch.me/events' } }

Is there not a way to create a webhook which will work with the above …cloudfunctions.net/… url?


#4

The target parameter can be any valid URL.