Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to get a response back from an API using tRestClient, however, get the below error:
</head><body id=ERR_ACCESS_DENIED>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&q=51.920...>
<blockquote id="error">
<p><b>Access Denied.</b></p>
Access control configuration.
I believe I have the correct settings.
I have tried the URL in a browser and I am able to make a call to the API
I have googled the issue and cannot find a solution for this.
I am using Talend 7.1 Enterprise.
Please can you help in how I can resolve this.
Much Obliged.
Thanks.
"ERROR: The requested URL could not be retrieved" is a common proxy server error. I cannot see anything you are doing wrong with your call. I can only assume that this is caused by your proxy. Are you sure you have configured your proxy access correctly? I notice that there is no username.
Can you copy your dynamic URL into a tJavaRow component and print it out to the terminal? Either use ....
System.out.println({url});
....or output the computed url to a tLogRow. Once you've done that, try the URL in a browser and see what you get. I suspect that there might be an error here.
Thank you for coming back to me.
I have the URL send to a tlog and it would seem that for some reason the variables keep getting added on the url.
For some reason he url does not display correctly as it should.
I have highlighted the variable. The far left size is the global variable however it is being repeated.
Can you copy and paste the code you are using here (not a screenshot) and copy and paste the generated URL here (not a screenshot)?
Apologies.
Please see URl
I think the issue is I do not understand how the API url is set up.
I tried it with a quick google API call but it does not work.
"http://www.google.com/?q=hi"
"http://www.google.com/?q="+((String)globalMap.get("lat"))+""
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://www.google.com/?q=Hi&lat=Hi">http://www.google.com/?q=Hi&lat=Hi</a></p>
<blockquote id="error">
<p><b>Access Denied.</b></p>
You have some proxy settings. Since your error message is essentially the same for both URLs fired, I'd look at the proxy settings. I do not get this error when I run your google url.
This is the API that i make call to, when directly entered to web browser it makes a call
This is the URL i put in the component
In the advance setting i have put the port and proxy it should be using.
Log Error:
<title>ERROR: The requested URL could not be retrieved</title>
<p>The following error was encountered while trying to retrieve the URL: <a href="http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&q=51.920...>
<blockquote id="error">
<p><b>Access Denied.</b></p>
</blockquote>
<p>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.</p>
<p>The following error was encountered while trying to retrieve the URL: <a href="http://api2.worldweatheronline.com/premium/v1/weather.ashx?key=agjdnepmndewrn8jrxagde4v&q=51.920...>
I am new to working with API and from what I can see this url should work.
"ERROR: The requested URL could not be retrieved" is a common proxy server error. I cannot see anything you are doing wrong with your call. I can only assume that this is caused by your proxy. Are you sure you have configured your proxy access correctly? I notice that there is no username.
@rhall Thank you soo much for this. It was a proxy issue. The Talend was running through a server which needed this url to be added to the Proxy. i just needed to make sure that I was not doing anything wrong due to the lack of my knowledge.