Finesse

Links

Sample Code

Load Balancing

Use SystemInfo API (check out https://developer.cisco.com/site/finesse/documents/dev-guide/)

Example
Query: http://finesse.domain.com/finesse/api/SystemInfo
Response:

<SystemInfo>
   <deploymentType>UCCE<deploymentType>
   <peripheralId>5001</peripheralId>
   <license></license>
   <currentTimeStamp>2014-01-27T13:07:08.687Z</currentTimeStamp>
   <status>IN_SERVICE</status>
   <timezoneOffset>300</timezoneOffset>
   <xmppDomain>xmppserver.xyz.com</xmppDomain>
   <xmppPubSubDomain>pubsub.xmppserver.xyz.com</xmppPubSubDomain>
   <primaryNode>
      <host>10.1.1.1</host>
   </primaryNode>
   <secondaryNode>
      <host>10.1.1.2</host>
   </secondaryNode>
</SystemInfo>   


As documented in Finesse Developer Guide, using Firefox plugin Poster is great for testing / developing against Finesse.
There is also a REST Client from http://www.wiztools.org/

Sample Gadgets from dev net
http://orourke.tv/finesse/

Sample Workflow URL

FINESSE REASON CODES LIST

Reference

Examples

Log Gathering

Client Network Connections

show network status nodns search :8445

Or try this

show network status nodns search :7443

On a Browser Refresh - Finesse Retrieves the following

Making REST request: method=GET, url=
/finesse/api/SystemInfo?nocache=1526048581775
/finesse/api/User/5552002?nocache=1526048581793
/finesse/api/User/5552002/Dialogs?nocache=1526048582232
/finesse/api/User/5552002/ReasonCodes?category=LOGOUT&nocache=1526048582234
/finesse/api/User/5552002/ReasonCodes?category=NOT_READY&nocache=1526048582237
/finesse/api/User/5552002/Workflows?nocache=1526048582255
/finesse/api/User/5552002/WrapUpReasons?nocache=1526048583420
/finesse/api/User/5552002/MediaPropertiesLayouts?nocache=1526048583422

HTTP Method Used

  • GET: Retrieve a single object or list of objects (for example, a single user or list of users).
  • PUT: Replace a value in an object (for example, to change the state of a user from NOT_READY to READY).
  • POST: Create a new entry in a collection (for example, to create a new reason code or wrap-up reason).
  • DELETE: Remove an entry from a collection (for example, to delete a reason code or wrap-up reason).

Agent Login/Logout/Ready/NotReady

Reference - https://developer.cisco.com/docs/finesse/#!usersign-in-to-finesse/usersign-in-to-finesse


URL: http://finesse1.xyz.com/finesse/api/User/1234 Method: PUT Content Type: Application/XML HTTP Request

<User>
   <state>LOGIN</state>
   <extension>1001001</extension>
</User>
<User>
<state>LOGOUT</state>
<logoutAllMedia>true</logoutAllMedia>
</User>
<User>
<state>READY</state>
</User>
<User>
<state>NOT_READY</state>
</User>

Third-party gadgets that are hosted on a separate web server can reference the JavaScript library accordingly: Refernce: https://developer.cisco.com/docs/finesse/#faq

<UserPref name="scheme" display_name="scheme" default_value=""/>
<UserPref name="host" display_name="host" default_value=""/>
<UserPref name="hostPort" display_name="hostPort" default_value=""/>
 
<!-- jQuery -->
<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>
 
<!-- Finesse Library -->
<script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/finesse.js"></script>

Gadget Caching

Clear Caching by restarting 'Cisco Tomcat ' (Cisco Finesse Tomcat on UCCX)
or pass a “nocache” paramter in the URL to clear the cache.
Example:

cURL

Example Using cURL to send Finesse Commands (See Finesse Developer Guide)
Download cURL for Windows from here: http://www.confusedbycode.com/curl/

curl -X PUT http://192.168.1.173/finesse/api/User/12001 --user "12001:12345" -H "Content-Type:application/xml" --data "<User><state>READY</state></User>"

This will send a HTTP PUT as in the below example:

PUT /finesse/api/User/12001 HTTP/1.1
Authorization: Basic MTIwMDE6MTIzNDU=
User-Agent: curl/7.36.0
Host: 192.168.1.173
Accept: */*
Content-Type:application/xml
Content-Length: 33

<User><state>READY</state></User>
WGET

WGET does not support PUT, but its it does support POST.
A HTTP POST is what the JavaScript library uses similar to below using wget
It includes in the POST the full URL which includes the PUT details as in above
Note: It also contains the Baisc Authentication String, which would need to be worked out before hand

wget http://192.168.1.173/gadgets/makeRequest --header="Content-Type: application/x-www-form-urlencoded; charset=UTF-8" --post-data="url=http%3A%2F%2Flocalhost%3A8080%2Ffinesse%2Fapi%2FUser%2F12001&httpMethod=PUT&headers=Content-Type%3Dapplication%252Fxml%26Authorization%3DBasic%2520MTIwMDE6MTIzNDU%253D&postData=%3CUser%3E%3Cstate%3EREADY%3C%2Fstate%3E%3C%2FUser%3E"

This send the following HTTP POST

POST /gadgets/makeRequest HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: 192.168.1.173
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 234

url=http%3A%2F%2Flocalhost%3A8080%2Ffinesse%2Fapi%2FUser%2F12001&httpMethod=PUT&headers=Content-Type%3Dapplication%252Fxml%26Authorization%3DBasic%2520MTIwMDE6MTIzNDU%253D&postData=%3CUser%3E%3Cstate%3EREADY%3C%2Fstate%3E%3C%2FUser%3E

UCCX URLs

https://uccx10-5a.ucce9.lab.orourke.tv:8445/finesse/api/SystemInfo
https://uccx10-5a.ucce9.lab.orourke.tv:8445/desktop/

jQUERY & Finesse JavaScript Library Location on Finesse

<!-- jQuery -->          
<script type="text/javascript" src="/desktop/assets/js/jquery.min.js"></script>
<!-- Finesse Library -->
<script type="text/javascript" src="/desktop/assets/js/finesse.js"></script>

Gather Finesse Logs

(Requires an SFTP server)

file get activelog desktop/logs/*

Or this should refine it by date

file get activelog desktop/logs/* recurs reltime days 2