Skip to content

Commit

Permalink
Updated examples to support un-documented notations
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Gutman committed Dec 8, 2011
1 parent b6eae09 commit 91a1a4c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 26 deletions.
25 changes: 15 additions & 10 deletions README.txt
Expand Up @@ -26,6 +26,8 @@ Zendesk Python Library is available on pypi, so installation should be fairly si
Example Use Example Use
----------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------


from zendesk import Zendesk, get_id_from_url

################################################################ ################################################################
## NEW CONNECTION CLIENT ## NEW CONNECTION CLIENT
################################################################ ################################################################
Expand All @@ -41,18 +43,21 @@ Example Use
# Create # Create
new_ticket = { new_ticket = {
'ticket': { 'ticket': {
'requester-name': 'Howard Schultz', 'requester_name': 'Howard Schultz',
'requester-email': 'howard@starbucks.com', 'requester_email': 'howard@starbucks.com',
'subject':'My Starbucks coffee is cold!', 'subject':'My Starbucks coffee is cold!',
'description': 'please reheat my coffee', 'description': 'please reheat my coffee',
'set-tags': 'coffee drinks', 'set_tags': 'coffee drinks',
'ticket-field-entries': { 'ticket_field_entries': [
'@type': 'array', {
'ticket-field-entry': [ 'ticket_field_id': 1,
{'ticket-field-id': 1, 'value': 'venti'}, 'value': 'venti'
{'ticket-field-id': 2, 'value': '$10'} },
] {
}, 'ticket_field_id': 2,
'value': '$10'
}
]
} }
} }
ticket_url = zendesk.create_ticket(data=new_ticket) ticket_url = zendesk.create_ticket(data=new_ticket)
Expand Down
43 changes: 28 additions & 15 deletions examples/__init__.py
Expand Up @@ -12,6 +12,15 @@ def get_id_from_url(url):
################################################################ ################################################################
zendesk = Zendesk('https://yourcompany.zendesk.com', 'you@yourcompany.com', 'passwd') zendesk = Zendesk('https://yourcompany.zendesk.com', 'you@yourcompany.com', 'passwd')


# Are you getting an error such as...
# "SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"?
zendesk = Zendesk('https://yourcompany.zendesk.com', 'you@yourcompany.com', 'passwd',
client_args={
"disable_ssl_certificate_validation": True
}
)


################################################################ ################################################################
## TICKETS ## TICKETS
################################################################ ################################################################
Expand All @@ -21,19 +30,22 @@ def get_id_from_url(url):


# Create # Create
new_ticket = { new_ticket = {
'ticket': { 'ticket': { _
'requester-name': 'Howard Schultz', 'requester_name': 'Howard Schultz',
'requester-email': 'howard@starbucks.com', 'requester_email': 'howard@starbucks.com',
'subject':'My Starbucks coffee is cold!', 'subject':'My Starbucks coffee is cold!',
'description': 'please reheat my coffee', 'description': 'please reheat my coffee',
'set-tags': 'coffee drinks', 'set_tags': 'coffee drinks',
'ticket-field-entries': { 'ticket_field_entries': [
'@type': 'array', {
'ticket-field-entry': [ 'ticket_field_id': 1,
{'ticket-field-id': 1, 'value': 'venti'}, 'value': 'venti'
{'ticket-field-id': 2, 'value': '$10'} },
] {
}, 'ticket_field_id': 2,
'value': '$10'
}
]
} }
} }
ticket_url = zendesk.create_ticket(data=new_ticket) ticket_url = zendesk.create_ticket(data=new_ticket)
Expand Down Expand Up @@ -105,10 +117,11 @@ def get_id_from_url(url):
new_group = { new_group = {
'group': { 'group': {
'name': 'Starbucks Group', 'name': 'Starbucks Group',
'agents': { 'agents': [
'@type': 'array', {
'agent': 123, 'agent': 123
} },
]
} }
} }
group_url = zendesk.create_group(data=new_group) group_url = zendesk.create_group(data=new_group)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -12,7 +12,7 @@
include_package_data = True, include_package_data = True,
install_requires = ['httplib2', 'simplejson'], install_requires = ['httplib2', 'simplejson'],
license='LICENSE.txt', license='LICENSE.txt',
url = 'http://github.com/stj/zendesk/tree/master', url = 'https://github.com/maxeventbrite/zendesk/tree/master',
keywords = 'zendesk api helpdesk', keywords = 'zendesk api helpdesk',
description = 'Python API Wrapper for Zendesk', description = 'Python API Wrapper for Zendesk',
classifiers = [ classifiers = [
Expand Down

0 comments on commit 91a1a4c

Please sign in to comment.