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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
HrushikeshMedhe
Contributor
Contributor

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

 

Labels (5)
3 Replies
iamabhishek
Creator III
Creator III

You can use the tFileFetch component that allows you to download files.
HrushikeshMedhe
Contributor
Contributor
Author

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.

Jmiles1658991691
Contributor III
Contributor III

Hi @Abhishek Chakraborty​ 

 

I want to download image from sharepoint. I have tried with tFileFatch & able to download .jpeg but when I'm trying to open it then its showing me error

 

Error:- It appears that we don't support this file format

 

0695b00000UwBJeAAN.png0695b00000UwBJjAAN.png0695b00000UwBJoAAN.png0695b00000UwBJtAAN.png