For each queue there are predefined notifications that we configure for our clients, however notification object can be overridden per each conversion request job POST.
Here is an example of a sample notification object:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
{ "user_notification_targets": { "scrape_status": [ { "type": "api", "uri": "http://mycompany.com/api/callback/status_from_omnirender", "method": "POST", "key": "[Authorization | ApiKey | Custom Auth Header Key]" "hash": "[key value, usually auth token]" } ], "error_status": [ { "type": "api", "uri": "http://mycompany.com/api/callback/error_from_omnirender", "method": "POST", "key": "[Authorization | ApiKey | Custom Auth Header Key]" "hash": "[key value, usually auth token]" }, { "type": "email", "address": "internal_support@mycompany.com" } ] } } |
In the above example, when there is a scrape_status update (conversion process and result), you receive an API callback notification in a HTTP POST request made to the URL you specified: http://mycompany.com/api/callback/status_from_omnirender
. For each error related issue, you’ll get a notification in a form of email to the given email address: internal_support@mycompany.com
but also an API callback to the specified URL: http://mycompany.com/api/callback/status_from_omnirender
.
Example for custom notification targets:
Make a HTTP POST with a CURL request: in which all scrape and error statuses are both sent to an email address and an API callback (in this case https://webhook.site/ is used, please create your own webhook endpoint and replace the hash below):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
curl --location --request POST 'https://api.omnirender.com/job/batch/addautohtml?apikey=demo&url=https://airshifumi.hands.agency' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'width=1080' \ --data-urlencode 'height=1080' \ --data-urlencode 'delay=5' \ --data-urlencode 'fps=30' \ --data-urlencode 'user_notification_targets={ "scrape_status": [ { "uri": "https:\/\/https://webhook.site/86173e53-6d39-42a8-8260-1073aa93e92b", "method": "post", "key": "OmnirenderApiKey", "hash": "uOkBPSM21cJw3bzxe3HZjNQLwEk6xqkkfBoVWBcf43HHKU9ehFhK3WJd80ompzqtAyGWKARTVrCWt4SAkbC6", "type": "api" } ], "error_status": [ { "uri": "https:\/\/videoconverter.bannerflow.com\/api\/callback\/omnirender", "method": "post", "key": "OmnirenderApiKey", "hash": "uOkBPSM21cJw3bzxe3HZjNQLwEk6xqkkfBoVWBcf43HHKU9ehFhK3WJd80ompzqtAyGWKARTVrCWt4SAkbC6", "type": "api" }, { "type": "email", "address": "support@omnirender.com" } ] },' |