Understanding Webhooks
What's a Webhook?
Imagine two apps chatting - one is Softools and the other is an API (Application Programming Interface). One app tells the other app some news. Webhooks help them do this. For example, one app might collect reviews and tell Softools about it.
This can be used to:
- Transferring data to another 3rd party application
- Sending notifications to users outside of Softools (Sending MS Teams Notifications)
- Automating your work
How to Set Up a Webhook
When you pick the "Webhook" option, a new window will pop up:
- "Destination URL": Think of this as the address you're sending your data to.
- You can choose if you want to send all the record information or just the information that's important
- Always tap on "Fill in Defaults" - it's like setting the basics for your message.
The headers we send are as follows:
- Softools-RecordId : the record ID
- Softools-Workflow-RunId : the run ID (as seen in the Workflow Runs view in App Studio)
- Softools-Workflow-NodeId : the node ID (as seen in the Workflow graph editor in App Studio)
How information is encoded:
- The value of Money fields is encoded as a string containing the formatted value.
- The value of all other numeric fields is encoded as a JSON number.
- The value of Date, DateTime and Period fields is encoded as a string with the format yyyy-MM-ddTHH:mm:ssZ representing the datetime in UTC.
If Something Goes Wrong
If the HTTP endpoint responds with a success code, the record is accepted by the workflow node and continues through the rest of the workflow subgraph.
If the HTTP endpoint may provide an error status - the following is an explanation of these:
- 408 Request Timeout,
- 429 Too Many Requests,
- 502 Bad Gateway,
- 503 Service Unavailable
- 504 Gateway Timeout, the request will be periodically retried until a success or other failure code has been returned or until 30 seconds have elapsed.
Otherwise, the HTTP request is treated as failed and the record is rejected by the workflow node and not continued through the rest of the workflow subgraph.
Any response body is currently ignored.
Please sign in to leave a comment.
Comments
0 comments