/mcpRequired Description Type Name Optional An object containing callback functions which are invoked when the callback scenario is triggered. The following are the request handlers (see below for details): • success(rsp) • error(rsp) Object handlers Optional Callback function that is invoked upon a successful request. The initialized object is then passed to the callback function as a parameter. Function success(rsp) Optional Callback function that is invoked upon an unsuccessful request. The initialized object is then passed to the callback function as a parameter. Function error(rsp) status Number The HTTP status code of the succeeded request. Optional content String The raw string response of the succeeded request. Optional object Object The parsed object response of the succeeded request. Optional error Object The error details from the failed request. Optional errorType String The type of error. Optional errorMessage String The message that is associated with the error. Optional REST Services JavaScript Representation of Finesse REST API Finesse JavaScript library uses JavaScript objects that represent the underlying REST API objects1 such as a User, Dialog, Phonebook and so on. When a Finesse JavaScript class is initialized, a corresponding REST API call is made, and the response is populated into a JavaScript object. In addition to having JavaScript object representations of Finesse REST API objects, the Finesse JavaScript library also supports the subscription to the Finesse Notification Service. When a Finesse notification is sent for a particular JavaScript object, the corresponding handler of the object is triggered with the updated JavaScript object as the parameter. 1 JavaScript objects that represent the underlying REST API objects are referred to as JavaScript REST objects further on in this document. This section establishes the principle behind the Finesse JavaScript objects. For example, consider the Finesse REST API called User. A User is an agent who can log in to the Finesse Desktop with valid credentials. A User object can be a composition of various fields such as State, Dialogs, Phonebooks, and so on. REST Collection Objects Finesse JavaScript library provides REST collection objects, which is a collection of Finesse REST API objects. For instance, a User is a Finesse JavaScript REST object, and Users is a Finesse JavaScript REST collection object, which can hold multiple User objects. Table 9: JavaScript REST Object with its Corresponding REST Collection Object JavaScript REST Collection Object JavaScript REST Object Dialogs Dialog Cisco Finesse Web Services Developer and JavaScript Guide, Release 12.5(1) 448 Cisco Finesse JavaScript APIs REST Services