# 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'
}
]
}
}
# Create the ticket and get its URL
result = zendesk.ticket_create(data=new_ticket)
# Need ticket ID?
from zendesk import get_id_from_url
ticket_id = get_id_from_url(result)
# 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.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共15个文件
py:5个
txt:5个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:zdesk-2.0.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
zdesk-2.0.3.tar.gz (15个子文件)
zdesk-2.0.3
MANIFEST.in 67B
PKG-INFO 616B
zdesk
zdesk_api.py 115KB
zdesk.py 11KB
__init__.py 44B
setup.cfg 59B
zdesk.egg-info
PKG-INFO 616B
requires.txt 19B
SOURCES.txt 259B
top_level.txt 6B
dependency_links.txt 1B
examples
__init__.py 5KB
setup.py 829B
README.md 3KB
LICENSE.txt 1KB
共 15 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功