NS AdminA
10/17/2024, 4:48 PMCeligo AI
10/17/2024, 4:48 PMAI generated answer (using internal Slack threads):Based on the conversations, to connect to a financial institution via SFTP from NetSuite, you will need to follow these steps: 1. Generate SSH Keys: You will need to generate a pair of SSH keys (public and private). The private key will be used in your SFTP connection configuration in NetSuite, and the public key will be given to the bank. You can generate these keys using a tool like PuTTYgen or ssh-keygen on Unix-based systems. 2. Upload Private Key to NetSuite: Once you have your private key, you will need to upload it to NetSuite. You can do this by navigating to Setup > Company > Documents > Files > New File. Then, select the private key file and upload it. 3. Create a Password Guid: After uploading the private key, you will need to create a password guid. This can be done by navigating to Setup > Company > Documents > Files, then click on the private key file you uploaded, and copy the Guid from the file details. 4. Get the Host Key: The host key is the public key of the SFTP server. This is usually provided by the bank. If not, you will need to connect to the SFTP server once manually (using a tool like PuTTY or FileZilla) to accept and save the host key. 5. Configure the SFTP Connection: Now you can configure the SFTP connection in your SuiteScript code. Here is a sample code snippet:
javascript
var connection = sftp.createConnection({
    username: 'username',
    passwordGuid: 'passwordGuid',
    url: '<http://sftp.server.com|sftp.server.com>',
    hostKey: 'hostKey',
    directory: 'directory'
});uploadconnectionjavascript
var myFileToUpload = file.create({
    name: 'filename.json',
    fileType: file.Type.JSON,
    contents: 'fileContents',
    description: 'description',
    encoding: file.Encoding.UTF8
});
connection.upload({
    directory: 'directory',
    filename: 'filename.json',
    file: myFileToUpload,
    replaceExisting: false
});Celigo AI
10/17/2024, 4:48 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.798167884
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.797534227
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.794347644
Celigo AI
10/17/2024, 4:48 PM