Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
cmalengrez
Contributor II
Contributor II

How to retrieve pdf binary file in Talend from API with TrestClient ?

Hi,

I'm a beginner with Talend Open Studio For Data Integration.

I need to develop a job to retrieve a pdf file which is sent as binary file by the the REST API, and then insert this pdf file as a BLOB into an oracle table.

I tried with a tRestClient Component and then a tJavaRow to write the PDF file based on the output of the tRestClient but it doesn't work.

The file is too small (24 ko) compared to the one I receive with the same call in Postman (250 ko) and I can't open it.

I didn't find any exemple about how to do this until now.

Could someone please help me with this ?

I put some screenshots of my configuration.

Thanks in advance.

Labels (3)
2 Replies
gjeremy1617088143

Hi, you can check in postman the headers apply to the request, and add them in tresclient http headers.

You can also use tFileFetch to download the file

cmalengrez
Contributor II
Contributor II
Author

Hi,

 

I think I already did it but without success.

I also tried using TREST and even TFETCHFILE instead of TRESTCLIENT but same result. File too small and unreadable.

Is there a more suitable component to do this ?

Or is it impossible and do I have to try to write custom java code to do this ?

Thanks