forked from GearPlug/pipedrive-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebhooks.py
More file actions
21 lines (18 loc) · 721 Bytes
/
webhooks.py
File metadata and controls
21 lines (18 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Webhooks(object):
def __init__(self, client):
self._client = client
def get_hooks_subscription(self, **kwargs):
url = 'webhooks'
return self._client._get(url, **kwargs)
def create_hook_subscription(self, subscription_url, event_action, event_object, **kwargs):
url = 'webhooks'
data = {
'subscription_url':
subscription_url,
'event_action': event_action,
'event_object': event_object
}
return self._client._post(url, json=data, **kwargs)
def delete_hook_subscription(self, hook_id, **kwargs):
url = 'webhooks/{}'.format(hook_id)
return self._client._delete(url, **kwargs)