-
Notifications
You must be signed in to change notification settings - Fork 89
/
README.txt
executable file
·76 lines (56 loc) · 2.23 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Zendesk API Wrapper for Python
=========================================================================================
Python Zendesk is wrapper for the Zendesk API. This library provides an
easy and flexible way for developers to communicate with their Zendesk
account in their application.
Requirements
-----------------------------------------------------------------------------------------------------
httplib2 is used for authentication and requests
(pip install | easy_install) httplib2
simplejson is used to serialze and deserialze requests and responses
(pip install | easy_install) simplejson
Installation
-----------------------------------------------------------------------------------------------------
Zendesk Python Library is available on pypi, so installation should be fairly simple:
(pip install | easy_install) zendesk
Example Use
-----------------------------------------------------------------------------------------------------
from zendesk import Zendesk, get_id_from_url
################################################################
## NEW CONNECTION CLIENT
################################################################
zendesk = Zendesk('https://yourcompany.zendesk.com', 'you@yourcompany.com', 'passwd')
################################################################
## TICKETS
################################################################
# List
zendesk.list_tickets(view_id=1) # Must have a view defined
# Create
new_ticket = {
'ticket': {
'requester': {
'name': 'Howard Schultz',
'email': 'howard@starbucks.com'
},
'subject':'My Starbucks coffee is cold!',
'comment': {'body': 'please reheat my coffee'},
'set_tags': 'coffee drinks',
'ticket_field_entries': [
{
'ticket_field_id': 1,
'value': 'venti'
},
{
'ticket_field_id': 2,
'value': '$10'
}
]
}
}
ticket_url = zendesk.create_ticket(data=new_ticket)
ticket_id = get_id_from_url(ticket_url)
# Show
zendesk.show_ticket(ticket_id=ticket_id)
# Delete
zendesk.delete_ticket(ticket_id=ticket_id)
# More examples in `examples` folder!