Webhooks allow your server to receive a POST request payload when a subscribed event happens in Prestavi. This means that you don’t need to continuously poll the API to check for updated data and instead you’ll instantly receive updates as they happen.
To create a webhook, log in to your Prestavi account and navigate to Manage > Developers > Webhooks. Choose the New Webhook button.
You can choose to configure the webhook with the payload data, headers, and additional custom properties that you need.
Additional information about webhooks:
We get it, sometimes processing a request doesn't go as planned. If you respond to the webhook request with a 500 error, the job action will receive a failed status.
If you provide a reason property with the response, then we’ll output that in the user interface for end users to know what happened.
If you would like the request to be automatically retried, then make sure to choose the "Automatically Retry Failures" option and set a delay period and max attempt (10 maximum).
The response the webhook request receives will determine the status of the action. The following response codes map to the corresponding action statuses
The webhook request payload will include aobject that contains a property. The link property is an API URL that you can use to send a request to update the status of the job action. This comes in handy when processing the request takes time (such as calling 3rd party APIs) and first you respond with a 202 status.