Webhhoks - How/ where to connect events to?

Hey Guys,

I hope this is fairly easy to answer and that maybe I’ve missed something on my end but, when you create a Webhook, there is a URL you link it to for the webhook to post data… I have a rest API set up for that reason. But once this data has been posted, how do I execute a script? Do I need the API to trigger a script? Have any of you set this up yet? If yes, could you please walk me through the steps to getting webhooks up and running? I’m very lost at the moment.

Thanks

Hi kramani,

I’m not sure I understand your question about triggering scripts. On the receiving end of the webhooks is your API server, hosted by your company or by a 3rd party. For example “https://api.mycompany.com”. This server will expose a endpoint (URL) for that webhooks, like “https://api.mycompany.com/my_notifications”. It’s in the implementation of that route on your API server that you will be invoking your script. Does that answer your question?

Hi,

In our cases, we use AWS Lambda for webhook event scripting as it’s written in the official document.
For instance, in AWS, you can setup AWS Lambda with API Gateway to create webhook apps (or even you can use AWS SAM to encode those application buildings).

API Gateway provides actual endpoint that you’ll put into the Shotgun wehbook’s url attribute and that triggers AWS Lambda function which executes scripts you want.
The image below is an exmaple flow to contact with Shotgun to get Shotgun info and sending notification to Slack.

vivaldi_2021-02-02_23-28-49

The basic ideas are almost same, even if you use other services I think.
So I hope that will help you.

1 Like