Skip to main content

Python API Wrapper for Zendesk

Project description

# Zendesk API Wrapper for Python

Zdesk is a Python wrapper for the Zendesk API. This library provides an
easy and flexible way for developers to communicate with their Zendesk
account in their application.

See the [Zendesk developer site](https://developer.zendesk.com/) for API
documentation. The underlying `zdesk\_api` module has been automatically
generated from this documentation.

## Requirements

Zdesk works with both Python 2 and Python 3. Tested on Python 2.7.5 and 3.4.1.

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

Zdesk is available on pypi, so installation should be fairly simple:

(pip install | easy_install) zdesk

## Related projects

* [zdeskcfg](https://github.com/fprimex/zdeskcfg): Automatically configure your
zdesk scripts from a configuration file and command line arguments.
* [zdgrab](https://github.com/fprimex/zdgrab): Download and decompress ticket attachments.

# Example Use

```python
from zdesk import Zendesk

################################################################
## NEW CONNECTION CLIENT
################################################################
# Manually creating a new connection object
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
################################################################

# List
zendesk.tickets_list()

# Create
new_ticket = {
'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': [
{
'ticket_field_id': 1,
'value': 'venti'
},
{
'ticket_field_id': 2,
'value': '$10'
}
]
}
}
result = zendesk.ticket_create(data=new_ticket, complete_response=True)

# URL to the created ticket
ticket_url = result['response']['location']

# Need ticket ID?
from zendesk import get_id_from_url
ticket_id = get_id_from_url(ticket_url)

# Show
zendesk.ticket_show(id=ticket_id)

# Delete
zendesk.ticket_delete(id=ticket_id)
```

See the [full example
file](https://github.com/fprimex/zdesk/blob/master/examples/__init__.py) on
github, however this is not anywhere close to covering all of the over 400 REST
API methods.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zdesk-2.0.1.tar.gz (13.2 kB view details)

Uploaded Source

File details

Details for the file zdesk-2.0.1.tar.gz.

File metadata

  • Download URL: zdesk-2.0.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zdesk-2.0.1.tar.gz
Algorithm Hash digest
SHA256 6ee58a50dc82326f576a00eef1171a0ad24e80b0d76357e8b9cd88ade4a97e43
MD5 a5518cf4038587584c55918bb2b0fdc9
BLAKE2b-256 c04b203b6c7d4c68093330b53fa30910aac2be9310a1806f5ba63161c3a1d390

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page