Permalink
Browse files

Updated examples to support un-documented notations

  • Loading branch information...
1 parent b6eae09 commit 91a1a4cdfcaf2c5cfff996a70c2a9588fcc3c222 Max Gutman committed Dec 8, 2011
Showing with 44 additions and 26 deletions.
  1. +15 −10 README.txt
  2. +28 −15 examples/__init__.py
  3. +1 −1 setup.py
View
@@ -26,6 +26,8 @@ Zendesk Python Library is available on pypi, so installation should be fairly si
Example Use
-----------------------------------------------------------------------------------------------------
+ from zendesk import Zendesk, get_id_from_url
+
################################################################
## NEW CONNECTION CLIENT
################################################################
@@ -41,18 +43,21 @@ Example Use
# Create
new_ticket = {
'ticket': {
- 'requester-name': 'Howard Schultz',
- 'requester-email': 'howard@starbucks.com',
+ 'requester_name': 'Howard Schultz',
+ 'requester_email': 'howard@starbucks.com',
'subject':'My Starbucks coffee is cold!',
'description': 'please reheat my coffee',
- 'set-tags': 'coffee drinks',
- 'ticket-field-entries': {
- '@type': 'array',
- 'ticket-field-entry': [
- {'ticket-field-id': 1, 'value': 'venti'},
- {'ticket-field-id': 2, 'value': '$10'}
- ]
- },
+ '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)
View
@@ -12,6 +12,15 @@ def get_id_from_url(url):
################################################################
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
################################################################
@@ -21,19 +30,22 @@ def get_id_from_url(url):
# Create
new_ticket = {
- 'ticket': {
- 'requester-name': 'Howard Schultz',
- 'requester-email': 'howard@starbucks.com',
+ 'ticket': { _
+ 'requester_name': 'Howard Schultz',
+ 'requester_email': 'howard@starbucks.com',
'subject':'My Starbucks coffee is cold!',
'description': 'please reheat my coffee',
- 'set-tags': 'coffee drinks',
- 'ticket-field-entries': {
- '@type': 'array',
- 'ticket-field-entry': [
- {'ticket-field-id': 1, 'value': 'venti'},
- {'ticket-field-id': 2, 'value': '$10'}
- ]
- },
+ '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)
@@ -105,10 +117,11 @@ def get_id_from_url(url):
new_group = {
'group': {
'name': 'Starbucks Group',
- 'agents': {
- '@type': 'array',
- 'agent': 123,
- }
+ 'agents': [
+ {
+ 'agent': 123
+ },
+ ]
}
}
group_url = zendesk.create_group(data=new_group)
View
@@ -12,7 +12,7 @@
include_package_data = True,
install_requires = ['httplib2', 'simplejson'],
license='LICENSE.txt',
- url = 'http://github.com/stj/zendesk/tree/master',
+ url = 'https://github.com/maxeventbrite/zendesk/tree/master',
keywords = 'zendesk api helpdesk',
description = 'Python API Wrapper for Zendesk',
classifiers = [

0 comments on commit 91a1a4c

Please sign in to comment.