Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
.settings/
.project
.pydevproject


.idea/
22 changes: 14 additions & 8 deletions supportbee/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-

import json

import requests

from supportbee.exceptions import ValidationFailureException, \
UnAuthorizedException, AccessDeniedException, ClientException, \
ServerFailureException, ServerException, SupportBeeException
import requests
import json


class SupportBee(object):
BASE_URL = "https://%s.supportbee.com"
Expand Down Expand Up @@ -80,7 +83,6 @@ def archive_ticket(self, ticket_id):
"""
return self._request('/tickets/%s/archive.json' % (ticket_id), method='POST')


def unarchive_ticket(self, ticket_id):
"""
Unarchives the given ticket. Supported parameters are available at https://developers.supportbee.com/api#ticket_actions
Expand All @@ -106,7 +108,6 @@ def star_ticket(self, ticket_id):
"""
return self._request('/tickets/%s/star.json' % (ticket_id), method='POST')


def unstar_ticket(self, ticket_id):
"""
Unstars the given ticket. Supported parameters are available at https://developers.supportbee.com/api#ticket_actions
Expand All @@ -115,7 +116,6 @@ def unstar_ticket(self, ticket_id):
"""
return self._request('/tickets/%s/star.json' % (ticket_id), method='DELETE')


def spam_ticket(self, ticket_id):
"""
Spams the given ticket. Supported parameters are available at https://developers.supportbee.com/api#ticket_actions
Expand All @@ -124,7 +124,6 @@ def spam_ticket(self, ticket_id):
"""
return self._request('/tickets/%s/spam.json' % (ticket_id), method='POST')


def unspam_ticket(self, ticket_id):
"""
Un-spam the given ticket. Supported parameters are available at https://developers.supportbee.com/api#ticket_actions
Expand All @@ -133,7 +132,6 @@ def unspam_ticket(self, ticket_id):
"""
return self._request('/tickets/%s/spam.json' % (ticket_id), method='DELETE')


def trash_ticket(self, ticket_id):
"""
Trashes the given ticket. Supported parameters are available at https://developers.supportbee.com/api#ticket_actions
Expand All @@ -142,7 +140,6 @@ def trash_ticket(self, ticket_id):
"""
return self._request('/tickets/%s/trash.json' % (ticket_id), method='POST')


def untrash_ticket(self, ticket_id):
"""
Un-trashes the given ticket. Supported parameters are available at https://developers.supportbee.com/api#ticket_actions
Expand Down Expand Up @@ -172,3 +169,12 @@ def show_reply(self, ticket_id, reply_id):
"""
return self._request('/tickets/%s/replies/%s.json' % (ticket_id, reply_id))

def add_label_to_ticket(self, ticket_id, label):
"""
Adds the label to the ticket with id ticket_id.
Supported parameters are available at https://developers.supportbee.com/api#adding_label
Params
ticket_id: SuppportBee Ticket ID
label: label name to add
"""
return self._request('/tickets/%s/labels/%s' % (ticket_id, label), method='POST')