Flatfile's webhooks give you the freedom to subscribe to events that happen with your imports as opposed to having to pull the information via our API. With webhooks, you will specify a
webhookUrl in your config, and when there is a completed file upload, we will send an HTTP POST request with the data to the specified URL.
This is one of our optional configurations and can simply be ignored if this doesn't interest you or meet your needs. You might want to look into this feature if:
To use webhooks, use the optional
webhookUrl as an object key within the
FlatfileImporter() method. In the example below, you'll see that this should go at the same level as fields, and will look like
webhookUrl: "https://your-data.com/endpoint" . For testing purposes, you can use something like webhook.site to get a test endpoint to play around with how this works.
In order for the webhookUrl setting to work properly, you must also set the
managed setting to true.
|String||Uniquely generated webhook event ID|
|String||Event type e.g batch.update|
|Integer||Total number of requests to be made for this event|
|Integer||Current request number, starting at 1|
|String||Current Batch ID|
|Integer||Current Settings ID|
|Integer||How many records in the request, currently this is not configurable and is set at 1,000 records per request maximum|
|Object||Array of row data objects that passed validation|
|Object||Array of row data objects that failed validation|