08-12-2016 05:35 AM
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
Solved! Go to Solution.
08-15-2016 02:49 PM
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
08-15-2016 02:49 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide