Productfeed Download
In order to obtain the productfeed you need to connect from your preferred FTP client with your user credentials and download the productfeed files.
How to connect from different clients and download your Productfeed files
In this section we explain how to connect with the 5 most commonly used FTP clients.
Terminal
-
To login from the terminal you can use the following command to list all the files (replace USER and PASS variables with your username and password):
curl --ftp-ssl -3 --user 'USER:PASS' --disable-epsv ftp://apm-feed.unftp.bol.com:21
-
In order to download a file you need to modify the URL to the full file name and add "--output" flag. For instance (replace USER/PASS/PRODUCT_FEED_FILE/FILE_NAME variables with your username, password, product-feed-file and the file name to save it to on your local machine):
curl --ftp-ssl -3 --user 'USER:PASS' --disable-epsv ftp://apm-feed.unftp.bol.com:21/<PRODUCT_FEED_FILE> --output FILE_NAME
FileZilla
Quick connect
-
Put hostname into "Host" field WITH protocol "ftpes://" as prefix (e.g. ftpes://apm-feed.unftp.bol.com)
-
Put your username in the "Username" field
-
Put your password in the "Password" field
-
Click "Quickconnect" (Note: there is no need to put anything in the "Port" field)
-
Pick your product-feed-file from the apm feeds folder and download
Using site manager (to save connection information)
-
Click "Site Manager" in the upper left (first icon)
-
Add a new entry and give it a name
-
As a protocol choose "FTP - File Transfer Protocol"
-
As a host put the hostname of the unftp instance WITHOUT "ftpes://" prefix (e.g. apm-feed.unftp.bol.com)
-
As Encryption put "Require explicit FTP over TLS"
-
As Logon Type we recommend you put "Ask for password" (which will not save the password, but you can pick your preference here)
-
Put your username in the "Username" field
-
Put your password in the "Password" field
-
Click "Connect" (You can now use that connection to always log in to the FTP Server)
-
Pick your product-feed-file from the apm feeds folder and download
FileZilla has a default functionality to not trust certificates automatically. Therefore, you might receive the following warning: "The server’s certificate is unknown. Please carefully examine the certificate to make sure the server can be trusted.". Once you have confirmed this warning with “OK”, it will not show this warning for all future connections. |
Cyberduck
-
Click "Open Connection" at the top bar
-
From the dropdown pick "FTP-SSL (Explicit Auth TLS)"
-
In the "Server" field put the hostname of the unftp instance WITHOUT "ftpes://" prefix (e.g. apm-feed.unftp.bol.com)
-
Put your username in the "Username" field
-
Put your password in the "Password" field
-
Click "Connect"
-
Pick your product-feed-file from the apm feeds folder and download
Transmit
-
Click "Servers" at the top bar
-
Click " + " on the bottom left to add new server and give the connection a name of your choosing
-
As "Protocol" choose "FTP with SSL/TLS"
-
In the "Server" field put the hostname of the unftp instance WITHOUT "ftpes://" prefix (e.g. apm-feed.unftp.bol.com)
-
Put your username in the "User Name" field
-
Put your password in the "Password" field
-
Click "Save" (No need to modify any other field)
-
Double-click your connection name to connect to the server
-
Pick your product-feed-file from the apm feeds folder and download
WinSCP
-
Open the login screen
-
Put "FTP" in the "File Protocol" field
-
Put "TLS/SSL Explicit encryption" in the "Encryption" field
-
Put the hostname of the unftp instance WITHOUT "ftpes://" prefix (e.g. apm-feed.unftp.bol.com) in the "Host name" field
-
Put your username in the "User name" field
-
Put your password in the "Password" field
-
Click "Login"
-
Pick your product-feed-file from the apm feeds folder and download
How to connect programmatically and download your Productfeed files
In this section we explain to connect programmatically using Java or PHP API.
JAVA API
To connect using Java you can use commons-net library https://commons.apache.org/proper/commons-net/ and the following code (replace your hostname/username/password):
String hostname = "<FTP Hostname>";
String username = "<Your Username>";
String password = "<Your Password>";
FTPSClient ftp = new FTPSClient();
ftp.connect(hostname, 21);
int reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
throw new IOException("Exception in connecting to FTP Server");
}
ftp.login(username, password);
ftp.execPBSZ(0);
ftp.execPROT("P");
ftp.enterLocalPassiveMode();
FTPFile[] files = ftp.listFiles();
for (FTPFile file : files) {
System.out.println(file.getName());
}
ftp.disconnect();
PHP API
To connect using PHP you can use the following code (replace your hostname/username/password):
<?php
$hostname = "<FTP Hostname>";
$username = "<Your username>";
$password = "<Your password>";
$ftp = ftp_ssl_connect($hostname);
// login with username and password
$login_result = ftp_login($ftp, $username, $password);
if (!$login_result) {
// PHP will already have raised an E_WARNING level message in this case
die("can't login");
}
ftp_pasv($ftp, true);
$file_list = ftp_nlist($ftp, ".");
var_dump($file_list);
// close the ssl connection
ftp_close($ftp);
?>