Skip to content

FTP API

The FTP API provides a set of operations for interacting with FTP servers, allowing users to manage files and directories.

Why Integrate FTP with EasyTask?

Integrating FTP with EasyTask enables you to automate file transfer and server management workflows. This integration allows you to:

  • Automate File Transfers: Upload and download files to/from FTP servers automatically as part of your EasyTask workflows without manual intervention.
  • Manage Remote Directories: Create, navigate, and delete directories on FTP servers programmatically through EasyTask orchestration.
  • Monitor File Operations: Retrieve file sizes, modification times, and directory listings automatically, enabling file monitoring and synchronization workflows.

Required Values in Vault

{
   "secret": {
      "ftp_port": "xxxx",
      "ftp_pwd": "********",
      "ftp_server": "xxx.xxx.xxx.xxx",
      "ftp_user": "abc"
   }
}

Example Usage

curl -X POST http://localhost:8008/run-integration \
-H "Content-Type: application/json" \
-d '{
    "is_credentials": {
        "userid": "test",
        "passwd": "test123"
    },
    "integration": "ftp",
    "uuid": "ae0e8ba9-423a-410e-bba5-e1933ff868c5",
    "init": {
        "vault_path_key": "ftp/secret"
    },
    "action": [
        {
            "get_connection": {}
        }
    ]
}'
{
    "integration": "ftp",
    "uuid": "ae0e8ba9-423a-410e-bba5-e1933ff868c5",
    "init": {
      "vault_path_key": "ftp/server1"
    },
    "error": false,
    "action": [
      {
      "get_connection": "220 (vsFTPd 3.0.5) 230 Login successful."
      }
    ]
}

Functions

get_connection

get_connection: This function establishes a connection to the FTP server.

This function takes no input parameters.

Output Parameter Type Description
response str Connection status message
{
    "get_connection": {}
}

get_pwd

get_pwd: This function retrieves the current working directory on the FTP server.

This function takes no input parameters.

Output Parameter Type Description
response str Current working directory path
{
    "get_pwd": {}
}

create_dir

create_dir: This function creates a new directory on the FTP server.

Input Parameter Type Description Mandatory
dir_name str Name of the directory to create yes
Output Parameter Type Description
response bool True if the directory was created successfully
{
    "create_dir": {
        "dir_name": "test_dir_0"
    }
}

set_cwd

set_cwd: This function changes the current working directory on the FTP server.

Input Parameter Type Description Mandatory
dir_path str Path of the directory to change to yes
Output Parameter Type Description
response bool True if the directory was changed successfully
{
    "set_cwd": {
        "dir_path": "test_dir_0"
    }
}

delete_dir

delete_dir: This function deletes a directory on the FTP server.

Input Parameter Type Description Mandatory
dir_name str Name of the directory to delete yes
Output Parameter Type Description
response bool True if the directory was deleted successfully
{
    "delete_dir": {
        "dir_name": "test_dir_0"
    }
}

put_file

put_file: This function uploads a file to the FTP server.

Input Parameter Type Description Mandatory
file_name str Name of the file to upload yes
Output Parameter Type Description
response bool True if the file was uploaded successfully
{
    "put_file": {
        "file_name": "readme.txt"
    }
}

get_file

get_file: This function downloads a file from the FTP server.

Input Parameter Type Description Mandatory
file_name str Name of the file to download yes
Output Parameter Type Description
response bool True if the file was downloaded successfully
{
    "get_file": {
        "file_name": "readme.txt"
    }
}

rename_file

rename_file: This function renames a file on the FTP server.

Input Parameter Type Description Mandatory
from_name str Current name of the file yes
to_name str New name for the file yes
Output Parameter Type Description
response bool True if the file was renamed successfully
{
    "rename_file": {
        "from_name": "readme.txt",
        "to_name": "readme.o"
    }
}

get_file_size

get_file_size: This function retrieves the size of a file on the FTP server.

Input Parameter Type Description Mandatory
file_name str Name of the file yes
Output Parameter Type Description
response int Size of the file in bytes
{
    "get_file_size": {
        "file_name": "readme.txt"
    }
}

get_modified_time

get_modified_time: This function retrieves the last modified time of a file on the FTP server.

Input Parameter Type Description Mandatory
file_name str Name of the file yes
Output Parameter Type Description
response str Last modified time of the file
{
    "get_modified_time": {
        "file_name": "readme.txt"
    }
}

get_dir

get_dir: This function retrieves a detailed directory listing from the FTP server.

This function takes no input parameters.

Output Parameter Type Description
response list List of file and directory details
{
    "get_dir": {}
}

get_nlst

get_nlst: This function retrieves a simplified directory listing from the FTP server.

This function takes no input parameters.

Output Parameter Type Description
response list List of file and directory names
{
    "get_nlst": {}
}

delete_file

delete_file: This function deletes a file from the FTP server.

Input Parameter Type Description Mandatory
file_name str Name of the file to delete yes
Output Parameter Type Description
response bool True if the file was deleted successfully
{
    "delete_file": {
        "file_name": "readme.txt"
    }
}

close_connection

close_connection: This function closes the connection to the FTP server.

This function takes no input parameters.

Output Parameter Type Description
response bool True if the connection was closed successfully
{
    "close_connection": {}
}

Frequently Asked Questions

How do I configure FTP credentials in EasyTask?

Use the EasyTask vault system to securely store your FTP server credentials. Navigate to the integration configuration page and add your FTP server address, port, username, and password under a vault key like ftp/secret.

Can I use FTP with both EasyTask Cloud and On-Premises?

Yes, FTP works seamlessly with both EasyTask Cloud and On-Premises deployments. The configuration process is identical.

How do I troubleshoot FTP connection issues?

Check the integration server logs in EasyTask for detailed error messages. Verify your FTP server address, port, and credentials in the vault, ensure the FTP server is accessible from the integration server, and test connectivity using the built-in connection test feature.

Next Steps