0% found this document useful (0 votes)
14 views3 pages

SFTP API Integration Guide

The document describes uploading and downloading a file to and from an SFTP server using the DataLoader.io API. It creates HTTP requests to the upload and download endpoints, sets authentication and request body parameters containing the SFTP server details, file path and data, and sends the requests to upload and download the file.

Uploaded by

R. Ünver Soykam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

SFTP API Integration Guide

The document describes uploading and downloading a file to and from an SFTP server using the DataLoader.io API. It creates HTTP requests to the upload and download endpoints, sets authentication and request body parameters containing the SFTP server details, file path and data, and sends the requests to upload and download the file.

Uploaded by

R. Ünver Soykam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Http http = new Http();

HttpRequest request = new HttpRequest();

[Link]('[Link]

[Link]('Authorization', 'Bearer <API_KEY>');

[Link]('Content-Type', 'application/json');

[Link]('POST');

String fileName = '[Link]';

String fileData = '...'; // base64-encoded file data

String sftpUrl = 's[Link]

String sftpUsername = 'my-sftp-username';

String sftpPassword = 'my-sftp-password';

String requestBody = '{"fileFormat":"csv","fileName":"' + fileName +

'","url":"' + sftpUrl + '","username":"' + sftpUsername +


'","password":"' + sftpPassword + '","fileData":"' + fileData + '"}';

[Link](requestBody);

HttpResponse response = [Link](request);

Http http = new Http();

HttpRequest request = new HttpRequest();

[Link]('[Link]

[Link]('Authorization', 'Bearer <API_KEY>');

[Link]('Content-Type', 'application/json');

[Link]('POST');
String sftpUrl = 's[Link]

String sftpUsername = 'my-sftp-username';

String sftpPassword = 'my-sftp-password';

String remoteFilePath = '/path/to/[Link]';

String requestBody = '{"url":"' + sftpUrl + '","username":"' + sftpUsername +

'","password":"' + sftpPassword + '","remoteFilePath":"' + remoteFilePath + '"}';

[Link](requestBody);

HttpResponse response = [Link](request);

String fileContent = [Link]();

You might also like