Downloading document from REST API

Four Stars

Downloading document from REST API

I have REST API in which there is document attached we need to download.

Can you suggest any method to do so?


I tried following ways.

  1. Connected the tRestClient to tFileOutputDelimiter, it sends garbage values for obvious reason the document datatype cannot be read.
  2. I connected the tRestClient to tfileOutputXML, attached are the screenshot of the subjob, RESTAPI schema and properties of the tfileOutputXML and tRestClient. Body field is document type which has got some data to be downloaded. I am getting null pointer exception for the same.

Note : I am using tRestClient as the REST API which I am using has got internal redirection which can be enabled in this component only.


Below is the complete error log.


Exception in component tFileOutputXML_1
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.tRESTClient_1Process(
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.tREST_1Process(
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.runJobInTOS(
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.main(
[FATAL]: dns_poc.api_doc_downloand_0_1.API_Doc_downloand - tFileOutputXML_1 null


Nine Stars

Re: Downloading document from REST API

You can use the tFileFetch component that allows you to download files.
Four Stars

Re: Downloading document from REST API

Hi Abhishesk,


Thanks for the suggestion it worked but I am afraid still the file content downloaded is garbage one.

Do you know if any encoding parameters might need to be tweaked on Talend side?





Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.