Celantur Documentation
celantur.com
  • Celantur Documentation
  • Container
    • Getting Started
    • Requirements and Installation
      • Requirements
      • Installation on Linux
      • Installation on Windows
      • Updates
    • Usage
      • Batch and Stream mode
      • REST API (v1) mode
      • TCP mode
      • Segmentation Masks and Metadata
      • Customize Blurring
      • Using CPU only
      • Object Tracking
    • Benchmarks
    • Release Notes
  • SDK/Edge
    • Getting Started
    • Requirements and Installation
      • Requirements
    • Benchmarks
    • Release Notes
  • Architecture
  • Troubleshooting
  • Cloud API
    • Getting Started
    • Concept
    • Authorization
    • Examples
    • API Endpoints
    • Webhooks
    • v1 (deprecated)
      • v1 API Endpoints (deprecated)
      • v1 Webhooks (deprecated)
      • v1 Examples (deprecated)
      • v1 Authorization (deprecated)
    • Release Notes
  • Tutorials
    • Image Anonymization in Esri ArcGIS Online
    • Image Anonymization in Esri ArcGIS Pro
    • Anonymization of ROS2 .mcap files
    • FARO Blurring Workflow
    • Anonymize Teledyne Flir PGR images
Powered by GitBook
On this page
  • Overview
  • Prerequisites for webhooks
  • Encode the webhook URL correctly
  1. Cloud API
  2. v1 (deprecated)

v1 Webhooks (deprecated)

Celantur Cloud API uses webhooks to notify your application when a file has been processed.

Previousv1 API Endpoints (deprecated)Nextv1 Examples (deprecated)

Last updated 23 days ago

Overview

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.

url = 'https://api.celantur.com/v1/file?method=blur&face=True&webhook='

response = requests.post(
      url, 
      data=image, 
      headers={'Authorization': auth_token}
    )

The payload sent to the webhook URL looks like this:

{
    customer_id={customer_id}
    file_id={file_id}
    file_status="done"
    original_link="https://api.celantur.com/v1/file/{file_id}/original"
    anonymized_link="https://api.celantur.com/v1/file/{file_id}/anonymized"
    binary_mask_link="https://api.celantur.com/v1/file/{file_id}/binary-mask"
    instance_mask_link="https://api.celantur.com/v1/file/{file_id}/instance-mask"
    metadata_link="https://api.celantur.com/v1/file/{file_id}/metadata"
}

Prerequisites for webhooks

Encode the webhook URL correctly

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 request
response = 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:

#upload-image
#get-anonymized-file
#upload-image
#upload-image