Tom Wellige

Ticket Validation against Zendesk

1 post in this topic

This little project provides a GSE Action that returns the current status of a given Zendesk ticket by making use of the Zendesk Core API.

 

Please find the download for this project here.

 

An included GSE Rule serves as an example that makes sure, that only users with a valid Zendesk ticket id are able to reach a support group.

 

 

License

 

Zendesk Ticket ID Check
v1.0.0

 

This is a Swyx Forum Open Source Project.
https://www.swyx-forum.com/forum/64-projects/

 

The MIT License (MIT)
Copyright (c) 2017 by Swyx Forum
Copyright (c) 2017 by Tom Wellige
All Rights Reserved.

 

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software.

 

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


This project also includes the following Open Source project:


JSON object class 3.5.4 - May, 29th - 2016

 

Licence:
The MIT License (MIT)
Copyright (c) 2016 RCDMK - rcdmk[at]hotmail[dot]com

 

https://github.com/rcdmk/aspJSON
https://github.com/rcdmk/aspJSON/blob/master/README.md

 

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Modifications needed for SwyxWare Call Routing
Tom Wellige, 03.05.2017

 

 

Installation

 

To successfully use this project you need to follow a few steps:

 

  1. The connection to Zendesk is done via the Zendesk Core API (REST), which is a web (https) API that takes and returns JSON data. For the web requests via https the "curl" (open source) command line tool is used. You need to grab the latest version of this tool from the project's webpage https://curl.haxx.se/download.html. Download the "Win32 - Generic" or "Win64 - Generic" package and extract it into a folder on your Swyx Server machine, e.g. "c:\Program Files (x86)\curl\"
    Make sure that the SwyxWare Service Account, i.e. the account all SwyxWare services are running under have read and execute privileges on this folder.
     
  2. Download and extract the project file into any local folder.
     
  3. Use the "IpPbx File Explorer" (SwyxWare DVD\ Swyx\Tools\File Explorer) to upload the two files from the "ase" subfolder of the download package into the global scope of the SwyxWare database. Alternatively the upload can also be done using the SwyxWare Administration. (Scope: Global / Category: Call Routing scripts).
     
  4. Create a new GSE rule and import the rse file from the "rse" subfolder of the download package (File - Import...).
     
  5. Double click the "Zendesk Ticket Status / Run GSE Action" block and switch to the Parameters page.
     
  6. To connect to Zendesk a Zendesk user login is required. This project uses a username/token authentication instead of username/password. This is a more robust solution, and keeps the call routing script independent from any password changes the Zendesk user might do. Please follow this link to learn how to obtain the needed login token. 
     
  7. By double clicking the two parameters "Zendesk Login User" and "Zendesk Login Token" you can set your personal login information.
     
  8. You also need to update the "Zendesk Domain". This is something like "yourcompanyname.zendesk.com". 
     
  9. Finally, if you have installed the "curl" tool from step 1 into another folder than the suggested one, you need to update the "CURL Path" parameter as well.
     
  10. Save the GSE rule and perform a call into your call routing user. You will be asked for a ticket id. As Zendesk ticket ids don't have a fixed length you have to end the id with a # (hash). Do not enter the leading # (hash) from the ticket id, just the number itself. If the previous steps went well and you have entered a valid ticket id and ticket is either in the new, open, pending or hold status, the call will be connected. If there was a problem with the previous steps, the ticket id was invalid or the ticket status is either solved, closed or unknown you will be asked to enter the ticket id again.
     

 

Trouble Shooting

 

This project communicates with a few external components. If the example in step 10 didn't work out you should take a look into the server trace file, identify the call and look for trace output from the GSE action that would look like

 

  • -------> GetZendeskTicketStatus

 

Once you have found this line for your test call you will find all important stuff before and after that line.

 

The following line contain the complete command line for the curl tool. You can copy and paste it into a command line to give it a try. Before hitting enter on a command line you have to replace the %LOGIN% placeholder by the zendesk login, in the format %USER%/token:%TOKEN%. The values for the username and token can be found in the trace right above start line.

 

Give the complete command line a try and see if you get something meaningful back from Zendesk. 

 

The next trace line contains the result Zendesk returned for your test call. If it looks like lots of data, then everything seems to be fine, if there is an error message included try to work out that error message until your result looks like lots of data.

 

I am not going to explain the JSON result format here, this is done in the Zendesk Core API documentation.

 

 

In case you have trouble getting this little project running or have specific questions, please open your own topic in this very sub forum.

 

1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.