By setting a webhook URL in the request to , a HTTPS POST request will be sent to the specified URL, as soon as the submitted file has finished processing.
import requests...webhook_url ='https://example.com/webhook/dev?sender=celantur&approve=always'# encode the URL you want to send the webhook to# returns 'https://example.com/webhook/dev?sender=celantur%26approve=always'webhook_url_encoded = webhook_url.encode()# set webhook in the POST requestresponse = requests.post('https://api.celantur.com/v1/file?method=blur&face=True&webhook='+ webhook_url_encoded, data=image, headers={'Authorization': auth_token} )
Webhooks are especially useful to trigger the download of a file, right after it has finished processing. See
Set the webhook URL in the request's URL parameter.
The webhook URL needs to be encoded correctly, in order to not interfere with the endpoint URL: