A python client library to access wazo-webhookd
from wazo_webhookd_client import Client
client = Client('localhost', verify_certificate=False, token=<auth-token>)
client.subscriptions.list()
client.subscriptions.list_as_user() # same thing, but only the subscriptions regarding the user making the request are considered
subscription = {
'name': 'test',
'service': 'http',
'config': {
'url': 'http://test.example.com',
'method': 'get'
},
'events': ['confd.users.create']
}
client.subscriptions.create(subscription)
client.subscriptions.create_as_user(subscription) # same thing, but only the events regarding the user making the request are considered
subscription = client.subscriptions.get(subscription_uuid)
subscription = client.subscriptions.get_as_user(subscription_uuid) # same thing, but only the subscriptions regarding the user making the request are considered
client.subscriptions.get_logs(subscription_uuid)
subscription = client.subscriptions.update(subscription_uuid, new_subscription)
subscription = client.subscriptions.update_as_user(subscription_uuid, new_subscription) # same thing, but only the subscriptions regarding the user making the request are considered
client.subscriptions.delete(subscription_uuid)
client.subscriptions.delete_as_user(subscription_uuid) # same thing, but only the subscriptions regarding the user making the request are considered
client.config.get()
config_patch = {
'op': 'replace',
'path': '/debug',
'value': True,
}
client.config.patch(config_patch)
push_notification = {
'notification_type': 'example_notification',
'user_uuid': '06306028-d9eb-4556-97d4-5e9f820309d0',
'title': 'Notification title',
'body': 'Notification body',
'extra': {'key': 'value'},
}
client.mobile_notifications.send(push_notification)
Follow the following steps to build a debian package for wazo-webhookd-client manually.
- Copy the source directory to a machine with all dependencies installed
rsync -av . <builder-host>:~/wazo-webhookd-client
- On the host, increment the changelog
dch -i
- Build the package
dpkg-buildpackage -us -uc