Cisco Cisco Finesse 8.5(3) Livre blanc

Page de 10
 
 
© 2016 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public Information. 
Page 7 of 10 
Then the XML file references an HTML file. 
 
 
 
The example HTML code below shows how the request is sent to the Zendesk gadget code when the button is 
clicked.  
 
So when we click on the button, it sends a request to the Zendesk gadget code. 
It’s saying that the action is to 
“create”, and you can give any number of parameters (via call variables) that you want to include, such as: name, 
email, case title, etc.  
Creating a ticket is as simple as creating a web request to the cloud-based Zendesk site with a specific json.  
By leveraging the sample code snippet below, you can add a button or link in your Zendesk gadget to create a 
case. Upon clicking this button or link, the java script (above) sends a HTTP request to the Zendesk gadget code 
(code snippet shown below). 
public void createTicket() {    
            //This function needs information of your Zendesk host 
(subdomain.zendesk.com), user id and password. 
            String sUrl = "https://" + m_sZendeskHost + "/api/v2/tickets.json"; 
            URL url = new URL(sUrl); 
            HttpURLConnection connection = (HttpURLConnection) 
url.openConnection(); 
            CertMgr.relaxHostChecking(connection); 
            connection.setRequestMethod("POST"); 
            connection.setDoOutput(true); 
            connection.setDoInput(true); 
            connection.setRequestProperty("Content-Type", "application/json");