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.

2 Likes

Hello, I know this is an old post, but I hope to get a reply.

I am also trying to set up Slack DMs to the person in charge based on specific events in FPTR.

Out of pure curiosity, I have a question.

The Webhook and Eventdaemon offer similar features, but why did you choose to use Webhooks?

Thank you!

It just depends on what infrastructure you want and need.

Webhooks can be run for free on AWS and within limits of the free tier if you use Serverless for example.
They are however, accessible in the cloud, so you need to ensure you secure them properly.

For the Event Daemon, you need to run this on a host machine, either locally on in the cloud.
(You can also build your own Event Daemon or event loop)
Since this can run locally, it can be easily securable.

Also Event Daemon can replay events if needed (in case of system outage for example).
Webhooks are instant and a failed delivery has to be manually re-delivered.

1 Like