Import Contacts via FTP

You can use this request to import contacts via an FTP client.

The Method

API Method
RESTPOSThttp://[Your URL]/api/2.0/imports/ftp
Your URL is the address of your Everlytic install.

Your method must be structured as follows:

ImportFtpImports(\struct | array $credentials, $mappings, $listIds, $settings) : obj


You will need the following parameters before you can use this API request:

$credentialsStringThe credentials required to log into the FTP server.Yes
$mappingsArrayA list of mappings where the key is the field to map, and the value is the position of the field in the CSV file
E.g. Array(‘email’ => 0, ‘name’ => 2) (email will be the first column in the CSV and name will be the third column in the CSV)
$listIdsArrayAn array of list IDs to import into.
E.g. Array(1, 2) will import into list 1 and 2 provided they exist.
$settingsArrayAn array of settings you need for the list.Yes


When filling out the $credentials and $settings parameters, you will need the following properties:


PropertyTypeDescriptionDefaultRequiredRead Only
HostnamestringThe FTP hostname to connect to.emptyYesYes
UsernamestringThe username to use when connecting to the FTP host.emptyYesYes
PasswordstringThe password to use when connecting to the FTP.emptyYesYes
PortstringThe FTP port21YesYes
FilestringThe location of the file on the FTP serveremptyYesYes


Update_duplicatesstringYes/No instruction on whether or not to update duplicates.YesYes
Update_usingstringThe ID to use when updating. Choose between:
none, unique_id, system_id

This field must be used together with custom_key_position
Custom_key_positionstringPosition of custom key in fileemptyYes
DelimiterstringThe delimiter used to separate values in the import.
You can choose between 'comma', 'semicolon', 'pipe', 'tab'.
Progress_email_addressstringEmail address to send the import report to.emptyYes

Sample Code


The rest of this document describes the example above, step-by-step.

In our Getting Started section we covered the four important components of an API request; URL, method, headers, and body.


Let's analyse the code sample above to determine where each line fits into this outline.

1. Tell the API Server that you are sending a request

The first two lines in the sample tell the server that you're sending an API request.


$request = new HttpRequest();

2. Load the Everlytic API

The next line of code tells the server which API URL to access for the request:


Your URL is the URL of your Everlytic installation.

3. Method

In this line of code, you tell the API which REST function to use:


4. Initiate the Headers

This section of the code opens the headers section and passes the authentication (including your API key).


'content-type' => 'application/json',

'authorization' => 'Basic YWRtaW5pc3RyYXRvcjpqSVYxT=='


5. Set the parameters and variables for the call

The following section of code tells the server which parameters and variables to use when importing the contacts in the list using this method.


"credentials": {

"hostname": "",

"username": "vagrant",

"password": "vagrant",

"post": "22",

"file": "ftp_test.txt"


"mappings": {

"email": "1",

"lastname": "2"


"listIds": [1],

"settings": {

"update_duplicates": "yes",

"delimiter": "comma"




6. Tell the API to output the Response

try {

$response = $request->send();

echo $response->getBody();


7. The final lines close the request

catch (HttpException $ex) {

echo $ex;


Translate »