Extension Webhooks


Extension Basics

Title
Webhooks
Name
ckanext-webhooks
Type
Public extension
Description
Webhooks extension for CKAN that allows users and services to register callback URLs for dataset and resource events (create, update, delete).
CKAN versions
Download-Url (zip)
Last commit
10 years ago (2015-08-13 22:00:20)
Url to repo
Category
Data Management & Quality


Background Infos

Description (long)
Show details

ckanext-webhooks

Webhooks for your CKAN. For example, as an app developer you want to be notified when a dataset your app depends on is updated. This extension allows users and services to register to be notified for common CKAN events, such as:

  • Dataset Events - new, update, delete
  • Resource Events - new, update, delete

Subscribers provide a callback url when registering for an event, and CKAN will call that url when the desired event happens.

Installation

Add webhooks to your CKAN plugins:

ckan.plugins = ... webhooks

The extension pushes webhook notifications onto the CKAN celery queue, so that the web app won’t block executions while the webhooks are firing. For this reason you need to make sure the celery daemon is running:

paster --plugin=ckan celeryd -c development.ini

Usage

At the moment there is no web interface to create Webhooks. Hooks must be registered through the action API. For example:

import ckanapi
ckan = ckanapi.RemoteCKAN('http://some.ckan.org')

# create webhook
hook = ckan.action.webhook_create(topic="dataset/create", address="http://example.com/callback")

# show webhook
ckan.action.webhook_show(id=hook)

# delete webhook
ckan.action.webhook_delete(id=hook)

Supported Topics

  • dataset/create
  • dataset/update
  • dataset/delete
  • resource/create
  • resource/update
  • resource/delete

Authentication

You may restrict creation of webhooks to users who are editors or administrators of organisations. Add a config option:

# Only let sysadmins create hooks
ckanext.webhooks.minimum_auth = sysadmin

# Only let admins and editors create hooks
ckanext.webhooks.minimum_auth = editor
Version
Version release date
(not set)
Contact name
Denis Zgonjanin
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints

Requires CKAN celery daemon to be running for asynchronous webhook delivery. Set ckanext.webhooks.minimum_auth to control who can create webhooks (sysadmin, admin, editor, none).

Plugins to configure (ckan.ini)
webhooks
CKAN Settings (ckan.ini)
DB migration to be executed
(not set)
<< back to Extensions