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
java.lang.NullPointerException
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.tRESTClient_1Process(API_Doc_downloand.java:1555)
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.tREST_1Process(API_Doc_downloand.java:867)
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.runJobInTOS(API_Doc_downloand.java:1867)
at dns_poc.api_doc_downloand_0_1.API_Doc_downloand.main(API_Doc_downloand.java:1701)
[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?

 

Thanks,

Hrushikesh.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now