Webhooks
When the schedule completes, the scraped data will be sent to the webhook you specified in the request body. The data will be sent as a JSON object with the following fields:id
(string): The ID of the schedule.data
(list of objects): The scraped data.
Authorization
header set to Bearer ${sonata-webhook-key}
where sonata-webhook-key
is your webhook key that you can find in the settings section of the Sonata UI.
Request structure
The request body should be a JSON object with the following fields:title
(string): The title of the schedule.scraper_id
(string): The ID of the scraper you want to use.cron_expression
(string): The cron expression for the schedule.urls
(list of strings): A list of URLs that the scraper should scrape.
Response
The response body will be a JSON object with the following fields:id
(string): The ID of the schedule.title
(string): The title of the schedule.scraper_id
(string): The ID of the scraper.cron_expression
(string): The cron expression for the schedule.urls
(list of strings): A list of URLs that the scraper should scrape.