"""
https://github.com/sjkingo/python-freshdesk
"""
from freshdesk.api import API
a = API('company.freshdesk.com', 'q8dnkjaS554Aol21dmnas9d92')
a.tickets.list_open_tickets()
a.tickets.list_deleted_tickets()
a.tickets.list_open_tickets()[0].created_at
##---------------------------------------------------------------------------------------------------
## tickets
##
# get ticket
ticket = a.tickets.get_ticket(4)
repr(ticket)
ticket._keys
# create a ticket
ticket = a.tickets.create_ticket('This is a sample ticket',
email='example@example.com',
description='This is the description of the ticket',
tags=['example'])
# update a ticket
ticket = a.tickets.update_ticket(4,
subject='This is an urgent ticket',
priority=4)
# delete a ticket
a.tickets.delete_ticket(4)
##---------------------------------------------------------------------------------------------------
## comments
##
a.comments.list_comments(4) # list comments in ticket
# create a note
comment = a.comments.create_note(4,
'This is a public note',
private=False)
# create a reply
a.comments.create_reply(4, 'This is the body of a reply')
##---------------------------------------------------------------------------------------------------
## contacts
##
repr(a.contacts.get_contact('1234'))
##---------------------------------------------------------------------------------------------------
##
##