Talend Connectivity with Share Point

82 Views Asked by At

Can anyone advise me how to make Share Point connectivity with TALEND and upload the file into Share Point? I am trying to upload files into share point with the help of Talend. I have used tFileFetch component to upload a file into share point with credentials, while loading encountering error connection time out.

enter image description here

1

There are 1 best solutions below

0
Emile Dadou On

I had a similar problematic, files would periodically be dropped in a folder and I had to send them to SharePoint.

So first for the authentication I created a joblet for that with all the necessary variables in context :

enter image description here

And inside I make the API call to get the token, extract it from the json and put it in the output of the joblet

enter image description here

Here is the configuration of the tRest componenent :

enter image description here

with the context.URL_MicrosoftOnline = https://login.microsoftonline.com

and the body would be like : "grant_type="+row1.grant_type + "&client_id=" +row1.client_id + "&client_secret=" +row1.client_secret + "&scope=" +row1.scope

Then to upload a file to SharePoint you need to send it as bytes array so to do it :

  • I read the file as bytes array using a tFileInputRaw enter image description here

I then store it in a globalVar :

enter image description here

And for the upload API call :

enter image description here

the Content-Type is application/pdf for me because I upload PDF files, but it can be changed and the URL looks like this :

Hope this helps