Intro - What are Webhooks anyway?

Webhooks are the most common, modern way of apps to interact with each other and tell each other that something has changed. So it is kind of a ping, "hey, please do something something changed on my end". E.g. a user profile has updated in your own backend application and you want another SaaS application, like e.g. Salesforce, to change the user details of that particular user in their app. In this case, you would create a webhook in the  app (Salesforce) and include it in your own backend application in a way that whenever a user is updated in your own system, it also pings Salesforce that an update occurred. A webhook can however not only notify about a particular resource, but also pass on information in the form of JSON in its so-called body. 


How do webhooks work?


A webhook can be created for each flow if you drag & drop the webhook icon at the beginning of the flow to the workspace. If you now either click on the status button or the Edit button, you see the webhook URL to trigger the particular webhook which looks like this e.g. 

https://api.dynamicinsight.com/v1/flow-webhook/*some id* where *some id* is replaced with your flow's id.



For additional security, are enabled by default with a secret Bearer token that needs to be passed in the header in the form of:


Authorization: Bearer ey...


Here Authorization is the header name, Bearer is the header type, which needs to be followed by an empty space, and than flowed by the secret token ey... which usually is a >50 characters long and in this example only abbreviated with ey... .


Webhook responses

You can determine two webhook responses, the http status code and the actual response value:


Response value

You can include responses in your webhooks in plain Python. A common response would look like this:

res1.value if res1.value == "myResult" else "{ \"valid\": false }"

This returns res.value if the request is true and otherwise valid: false. Note that you must escape \" within ".



Http status code

The response status code should be one of the three digit http status code numbers.