1
Prerequisites
Here you can see all you need to have or do before starting this course to
make the most out of it.
01
To upload private apps to your Zendesk instance you need a Professional or
Enterprise plan.
02
You need to have ZAT installed
03
The app in this course uses HTML, JavaScript and a bit of CSS, you will need
to have a basic understanding of at least HTML and JavaScript to understand
all the code snippets in this course.
2
Code Snippets
In the following pages you will find the code snippets used throughout the
course.
They appear in the order they were presented in. They are also organized by
modules they were used in and labeled with the slide title.
Initialize the Zendesk Apps Framework.
Create a skeleton app Initialize the Zendesk Apps Framework
$ zat new var client = ZAFClient.init();
Listen for Apps Framework events
Fetch information about a ticket
app.registered / Learn how to use ZAFClient.get to fetch ticket information
client.on(“app.registered”, function(e) {
client.get(“ticket.subject”).then(function(result) {
document.getElementById(“search_term”).value =
result[“ticket.subject”];
Work with external APIs
Use ZAFClient.request to make HTTP requests / Use the Help Center API
// Make a request to the Help Center API
client
.request(“/api/v2/help_center/articles/search.json?query=” + query)
Build the app UI and hook it up with its logic
Add an input field for the search / Trigger a search Update the ticket / Add a tag to the ticket
when typing in the search field
<input function useArticle(snippet, url) {
class=”c-txt__input c-txt__input--bare client.invoke(
c-txt__input--media__body”
“ticket.editor.insert”,
id=”search_term”
snippet + ‘<br /><br /><a href=”’ + url +
onkeydown=”searchHelpCenter()” ‘”>’ + url + “</a>”
type=”text” );
/> client.invoke(“ticket.tags.add”,
“used-help-center-app”);
}
Upload the app into your Zendesk Instance
Validate your app Package your app
$ zat validate $ zat package
3
Resources
Here you can find useful resources to use regarding the Apps Framework,
some of which we referenced in the course.
01 Manifest reference
02 App Internationalization
03 Setting the app location
04 Using the Zendesk App Tools (ZAT)
05 Working with framework events
06 JavaScript Promises - a Zendesk introduction
07 Zendesk Garden