cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
438
Views
2
Helpful
1
Replies

Calling External Api

dhinesh.r
Level 1
Level 1

Hello ,

I have tried to call the external public API for testing from the gadget which runs within Finesse Server.

But it is not working due to cross domain policy .

Is Finesse allows to call external API hosted in different servers ?

Below is the code i have modified from Sample Webservice gadget.

// TODO: change Rest path to match your own web server

  this.myrestRequest("/country/get/iso2code/IN", {

                method: 'GET',

                success: handlers.success,

                error: handlers.error,

                content: contentBody,

            });

            return this;

mymakeRequest : function (url, handler, params) {

            clientLogs.log("mymakeRequest(): in method");

               

            params = params || {};

            params[gadgets.io.RequestParameters.HEADERS] = params[gadgets.io.RequestParameters.HEADERS] || {};

           

                       

            // This is the url we want to get to:

            gadgets.io.makeRequest(encodeURI("http://services.groupkt.com") + url, handler, params);

            clientLogs.log("mymakeRequest(): io.makeRequest to http://10.221.226.26"+url);

        },

Thanks

Dhinesh

1 Accepted Solution

Accepted Solutions

dekwan
Cisco Employee
Cisco Employee

Hi Dhinesh,

Unfortunately Finesse 11.0 and below does not support CORS and there is no way to get around it. The good news is that it is supported in 11.5 which is coming out soon.

Thanx,

Denise

View solution in original post

1 Reply 1

dekwan
Cisco Employee
Cisco Employee

Hi Dhinesh,

Unfortunately Finesse 11.0 and below does not support CORS and there is no way to get around it. The good news is that it is supported in 11.5 which is coming out soon.

Thanx,

Denise