AnsweredAssumed Answered

Get Reason Codes in Non-Gadget Sample

Question asked by AzizShaik on Feb 6, 2015
Latest reply on Apr 22, 2015 by AzizShaik

Hi,

 

I used the non-gadget sample in to custom .net web application. to get it to work i have used the redirect rules give to me in my earlier posts, i am kind of struck at point where i need to pass in the reason code for the agent to sign out. i have tried 2 approaches to get the reason codes.

 

  1. Send an ajax call to the finesse server to get the reason codes, the ajax call code is mentioned below, using this approach i ran in to a couple of issues.
    1. i get a No 'Access-Control-Allow-Origin' header is present on the requested resource error when i do a GET operation.
    2. i get a parser error if i change the dataType to jsonp in the ajax call, even if i get the reason codes back from the server.
  2. the second approach i used is to wire up a call in finessenongadget.js to get the reason codes. but for some reason the redirect piece doesn't work. when i look at debugger in chrome, i could see that the request wasn't redirected to the finesse server and hence i was getting an error.







First Approach

 

          $.ajax({

                    type: 'GET',

                    url: reasonCodeUrl,

                    headers: {

                        "Authorization": "Basic " + btoa(username + ":" + _password),                       

                    },

                    dataType: 'xml', or 'jsonp'                   

                    success: function () {

                        alert('Success!');

                    }

                });

 

Second Approach.

 

this.getReasonCodes = function (agentid, handler, errHandler) {       

        var method = "GET",           

            url = _webappPath + "/api/User/" + agentid + "/ReasonCodes?category=NOT_READY";       

        _sendReq(url, method, null, null, handler, errHandler, null, null);

        };

 

Has any one faced this issue before, any help would be appreciated.

 

Aziz

Outcomes