Inbound Webhooks

Couchdrop supports data ingestion via webhooks.

Example 1: Upload via CURL

To upload via curl:

curl -v -F [email protected] 
-H "Authorization: Bearer <token>" 
https://my.couchdrop.io/webhook/0479ae21-a677-49bb-9937-d5841b3b9ed1

Example 2: Upload with Python using a stream

import requests

binary_file_path = "/Users/donald/testing/trophy.jpg"
webhook_id = "<webhook_id>"
token = "<token>"

with open(binary_file_path, 'rb') as f:
 data = f.read()
    
 res = requests.post(
     url='https://my.couchdrop.io/webhook/' + webhook_id, data=data,
     headers={
      'filename': 'trophy_webhook.jpg', 
      'Content-Type': 'application/octet-stream', 
      'Authorization': 'Bearer ' + token
     })

Example 3: Upload JSON data to a file

curl -H "Filename: json_test_file.json" 
-H "Content-Type: application/json" 
-XPOST https://my.couchdrop.io/webhook/0479ae21-a677-49bb-9937-d5841b3b9ed1 
-d '{"id": "dasflk34masd", "event": "purchase", "customer": "testaccount"}'

Last updated

Was this helpful?