This is a Zendesk Ticket Viewer for the Zendesk customer service tool. This ticket viewer was created by me as part of the interview process for a Zendesk Software Engineer Internship for the Summer of 2022.
This Zendesk Ticket Viewer uses the Zenpy library to make a call to the Zendesk API and to display all tickets at the CLI
.
Tickets are stored locally in a ZendeskTicket object. This object has a tickets
data member that is populated by a python dictionary with the first API call. For this python dictionary, each key is the Ticket ID Number and the value is a single Ticket Dictionary. This structure is ideal as it allows rapid access of ticket information based on key queries that match ticket fields.
The ZendeskTicket class includes methods that do the following:
- display all tickets
- display all search tags
- display all tickets with a search term in the subject field
- display all tickets with a search term in the description field
- display all tickets with a tag identifier
- display a ticket with a particular ticket ID number
- update local ticket data with a new Zendesk API call
- change the number of tickets displayed per page (default is 25 tickets per page)
This Zendesk Ticket Viewer is run as a script from main()
but the ZendeskTicket can also be used as an imported class. There are detailed docstrings regarding parameters, returns, and data validation for each class method and for other defined functions used by the class.
I hope you enjoy my work!
- Sign up for a free trial with Zendesk.
- Take note of the email address you use, your password, and your subdomain. You will need this information to create your login credentials for Zendesk API calls.
- Log in to your account and enable password access for Zendesk API calls.
- Install the Zenpy library on your computer.
Fork
this repo.Clone
the forked copy of this repo to your local computer.- Follow the directions in
credentials.py
to add your login credentials. - Need tickets to test? Post the included
tickets.json
file to your new account. Run ZendeskCodingChallenge.py
- Check that your email address, password, and subdomain are all typed correctly, enclosed by quotation marks, contain no extra spaces or characters, and no extra punctuation.
- Passwords that included single or double quotation marks may not work; update your password and try again.
- New Zendesk accounts have password authentication for API calls disabled by default; go to
https://YourSubdomain.zendesk.com/admin/apps-integrations/apis/apis/settings
, whereYourSubdomain
is the subdomain you chose in your free trial sign up, and change this setting toenabled
. - Try posting the
tickets.son
file to your new account using cURL:
curl https://{YourSubdomain}.zendesk.com/api/v2/imports/tickets/create_many.json -v -u {your_email_address}:{your_password} POST -d @tickets.json -H "Content-Type:application/json"