cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
688
Views
0
Helpful
3
Replies

Get Reason Codes in Non-Gadget Sample

azizshaik
Level 1
Level 1

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

3 Replies 3

azizshaik
Level 1
Level 1

Ok,

I was able to narrow this down, when i ever i am trying to send a GET request with parameters it doesn't seem to work but if i just retrieve a single reason code, it seems to work. so my question over here is why does this url work

http://myurl/finesse/api/User/70000/ReasonCode/12

while this doesn't

http://myurl/finesse/api/User/70000/ReasonCodes?catergory=NOT_READY

i have looked at the _sendReq function in finesseongadet.js file and have changed the flag processData to true as well, it still doesn't seem to work.

am i missing some thing over here... any help would be appreciated...

Hi Aziz,

I am trying to figure out the amount of effort required to build the complete call control toolbar by utilizing the non-gadget sample.

Based on your above post, it looks like you have been implementing agent status and call control using non-gadget sample, could you help to understand an estimated effort required to build the non-gadget based cti toolbar in an existing custom CRM web application?

Thanks,

Roshan

the non-gadget is a good example to start with as a POC but i would recommend using the finesse javascript libs and the caxl libs in CDN.

there is a lot of functionality that needs to be put in case you are starting from scratch and the non-gadget source wont suffice your needs. it will require considerable effort and time just to emulate the call control since you will have a lot of factors that needs to be considered like failovers, updating the dialog variables etc..

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: