Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
TJones_AuctionEdge
Contributor
Contributor

API POST

I'm using Talend Open Studio for ESB - Version: 8.0.1. I have a job that loops thru data and creates a CSV for each data element, like this:

> ID   DATA

> A   QQQQ# $%$

> B   WWWE^UTU

etc. The job creates FileA.csv, then FileB.csv etc. That all works, but the next step I need will take FileA.csv and POST that data to an API.

The URI for each file is different, so I'm using a context to create the link. The links look like this:

https://<<USER>>:<<PASSWORD>>@<<HOST>>/prod/updatenodes?application_code=fileA

There is a different application code for each file. I've tested the link for these files in Postman, and they all work, here's the message:

"result": "success",

"message": "Update batch submitted with 0 items",

"threadId": []

So, the links are correct. In Talend ESB, I'm using a tFileFetch object with Post Method checked. The file image_Tal.png shows the settings

of the tFileFetch. When I use a context URL, I get this error:

> Exception in component tFileFetch_1 (Cognosos)

> java.lang.IllegalArgumentException: host parameter is null

I also tried hard-coding the full URL into the filefetch object, I get this error:

Sep 08, 2022 1:49:39 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry

INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: no further information

So, how do I post the data from the CSV to the API? I've tried tRest, but it wouldn't allow me to use a context variable as the URI.

Because each different file has a different ID/Password, I need to use a variable for each iteration in the loop. When I use a

context for the URI, it gives me the error "URI is not absolute". I had the same problem with RestRequest and RestClient.

Are there some settings I need to add to Talend ESB? I'm using the defaults now - I'm not sure what settings to change. How do I use

Talend to POST this API data, assuming I've got a link that is working in Postman?

Labels (2)
2 Replies
Anonymous
Not applicable

Hi

Use tHttpRequest or tRest component, can you show me the URL you use on tRest component? FileA is the string value or you need to post parameter from file?

 

Regards

Shong

TJones_AuctionEdge
Contributor
Contributor
Author

When I tried thttprequest, I got an "Bad Credentials" error. It's odd, because when I use the same https link in Postman, I get a success message. Here are the settings I'm using in the thttprequest object (a header for the key value).