Created by: David Womer on 13-04-2012 05:03:41 PM Team, I'm trying to use the gadget.io.makerequest method to retrieve JSON data within my gadget. I have this working if I do not pass any paramters to my service, however, if I add ?parameter=value I get a 403 error. I have been able to succesfully call this service with paramters direclty form the web browser as well as an http client. Here's the code I'm using:
function makeJSONRequest() { var params = {}; params[gadgets.io.RequestParameters.CONTENT_TYPE] = "text/html"; params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET; var url = "http://app02:8080/soap.php?accountNumber=11111"; gadgets.io.makeRequest(url, response, params); };
Subject: RE: gadget.io.makerequest GET with Paramaters fails with 403 Replied by: David Lender on 16-04-2012 10:44:17 AM It appears the error is coming from your web server not Finesse. I suggest you try content-type application/xml rather than text/xml.
Subject: RE: gadget.io.makerequest GET with Paramaters fails with 403 Replied by: David Womer on 16-04-2012 11:28:35 AM Hi David,
This appears to be working today. I'm guessing it was some kind of cacheing issue but I'm not sure where the problem was. I tried a number of different content types, restarted the web server, and restarted by dev environment but kept getting the same result. Does Finesse cache the widget code?
The strange part about this is that it would only fail when I passed parameters in the URL string. Otherwise it would work fine. You can see the request on the web server side:
the 172.35.1.67 address is Finesse. I was just about to turn up some additional logging, but it starting working.
-Dave
Subject: RE: gadget.io.makerequest GET with Paramaters fails with 403 Replied by: David Lender on 16-04-2012 12:01:26 PM
Does Finesse cache the widget code?
No cache. You should be able to just logout the agent(s) and log back in again and the latest gadget xml is fetched.
Subject: RE: gadget.io.makerequest GET with Paramaters fails with 403 Replied by: David Womer on 16-04-2012 01:53:25 PM David - Thanks for the response. I think I figured out where the cacheing is occurring. gadgets.io.makerequest() caches web calls be default, so you need to disable cacheing when the request is made as outlined in this document:
Are You use it to conrtact with some API which remains basic auth? because It works for me when some server to which I want send request is without authorization but when I would like to send to Finesse API (remain basic auth) it show in logs that it remain authentication.
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: