Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hypchat/restobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dateutil.parser
import dateutil.tz
import six
from hypchat.requests import HttpNotFound

_urls_to_objects = {}

Expand Down Expand Up @@ -206,6 +207,17 @@ def invite(self, user, reason):
'reason': reason,
})

def delete_webhook(self, id):
"""
Deletes a given webhook:
https://www.hipchat.com/docs/apiv2/method/delete_webhook
"""
try:
self._requests.delete(self.url + '/webhook/' + str(id))
except HttpNotFound:
return False
return True

def create_webhook(self, url, event, pattern=None, name=None):
"""
Creates a new webhook.
Expand Down