This is a command line interface application to access tickets on a Zendesk user's account. It is capable of connecting to the Zendesk API and submitting HTTP requests to retrieve single tickets or a page of tickets (using pagination). Details of the response are given to the user - more detail for single-ticket view, and brief details for page view. This program was written in Java.
- Clone the project into desired directory
> git clone https://github.com/keensworth/zendesk-coding-challenge.git zcc
- [IMPORTANT] - Navigate to the following directory and edit the config.properties file to include your Zendesk credentials. This can be done in your file explorer and favored text editor.
...\zcc\src\main\resources\config.properties
It will look like
email=
token=
subdomain=
- cd into the cloned directory.
> cd zcc
- Build the project with Maven.
> mvn package
- cd into the
target
directory.
> cd target
- Run the following jar file.
> java -jar zendesk_coding_challenge-1.0-jar-with-dependencies.jar
- Use the program, following the prompts.
At any point during use, the user will have access to a list of commands they can execute, such as
(t) Fetch ticket by ID
(a) View all available tickets
(q) Quit
The user must simply enter the text within the parentheses for the choice they would like to select, and press enter/return. The only unique case is when you choose to view a ticket. In that case, you will be prompted with
Ticket ID:
and you must enter the ID of the desired ticket.
Images of use are available at the bottom of this README.
This project was created under a Model View Controller design pattern. This is because the project was relatively interactive, and it helped separate user interaction and console rendering from the API logic.
ConsoleManager
: Manages overall program state, communicates to the Console and to the APITicketManager
: Manages high level calls to the API for ticket retrieval
Console
: Handles all console printing, including prompts, queries, warnings, errors, and ticket/page display
ConsoleController
: Handles all user input and manipulates the state of ConsoleManager
ZendeskAPI
: Stores encrypted auth codes and host URL, accepts raw requests to the Zendesk APITicketFetcher
: Low-level utility for making ticket-specific calls to the Zendesk APIUserFetcher
: Low-level utility for making user-specific calls to the Zendesk API (to retrieve names from IDs)
JSONParser
: Responsible for translating all JSON HTTP responses into Java objects and retrieving specific values