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
20 lines (17 loc) · 778 Bytes
/
Copy pathwebhooks.py
File metadata and controls
20 lines (17 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Webhooks(object):
def __init__(self, client):
self._client = client
def get_hooks_subscription(self, **kwargs):
url = "webhooks"
return self._client._get(self._client.BASE_URL + 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(self._client.BASE_URL + url, json=data, **kwargs)
def delete_hook_subscription(self, hook_id, **kwargs):
url = "webhooks/{}".format(hook_id)
return self._client._delete(self._client.BASE_URL + url, **kwargs)