Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
fbt
Contributor
Contributor

Retrieving picture from a tRestClient

Hello !

I have an issue and after a long search, I haven't find a way to solve it, so I'm asking !

I have to develop a batch Integration job. Our HR team is using Talentsoft tool, and I have to generate a weekly email in which I have to embedded picture of each employee.

The REST webservice provided by Talentsoft is a basis GET REST one with bearer token authentication. The answer has a Content-Type image/jpeg (a call to this webservice with a simple postman only show the picture as body result). I have made many different tries, but I do not find a way to manage this picture returned in Talend, neither to embedded it into an email body, nor to generate a picture file on disk I could have encoded in base64 later.

Does anyone knows how to handle this kind of Concent-Type with a tRESTClient ?

Documentation about the API used is here : https://ems.talent-soft.com/api/documentation/#!/EmployeePhoto/get_api_v1_directory_employees_id_photo_namingMethod

Thanks in advance !

Labels (4)
7 Replies
pakapi_
Creator
Creator

I'm not able to test it, but maybe tFileFetch component will help ?

Are you getting any valid response ? How does it looks like ? Is it byte array ?

fbt
Contributor
Contributor
Author

Hello,

 

Thanks for your answer. TFileFetch does'nt fit, as I don't get the picture url in the API response, but the picture itself. I have a valid response and something that's looking like a picture file content in the string response field, but event if I push it into a file, it's not a valid picture file.

pakapi_
Creator
Creator

I think you should convert your response to image. Please read about "bytes to pictures in Java". Maybe this is a solution.

Regards

Jmiles1658991691
Contributor III
Contributor III

@Fabien Burnet​ @Kamil Kowalczyk​ 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

pakapi_
Creator
Creator

@Juanita miles​ maybe your source file is broken ?

Try to upload a valid file to sharepoint, and then try to download and open it.

Jmiles1658991691
Contributor III
Contributor III

@Kamil Kowalczyk​ I'm able to open this image in browser with same URL

pakapi_
Creator
Creator

Meybe this article will be helpful: https://community.talend.com/s/question/0D53p00007vCkqHCAS/sharepoint-file-download-using-tfilefetch-or-thttprequest