Documentation Navbar
Curl Curl
  • Introduction
  • Authentication
  • Upload File
  • Delete File
  • Download File
  • Transfer File
  • Introduction

    Welcome to the FTP API's,

    FTP API is designed for people who need to perform actions like DOWNLOAD, UPLOAD, DELETE and TRANSFER on the FTP / SFTP server using REST API's.

    Our API lets you control nearly all aspects of your FTP / SFTP server operations programmatically, from uploading and downloading files to transferring and deletions based on GET, POST and DELETE operations.

    To POST files into the FTP / SFTP server, or to GET / DELETE files from the FTP / SFTP server, you will need some basic details like: username, password, port, and host URL to log in on the FTP / SFTP server. The REST API uses plain JSON over HTTP.

    This guide contains all info about how files can be imported, exported and deleted from FTP / SFTP Server using FTP API.

    Go Ahead...


    Note: We are not asking/storing any information on this website.

    API Endpoint:

    https://www.ftp-api.com/ftp/

    Welcome to the FTP API's,

    FTP API is designed for people who need to perform actions like DOWNLOAD, UPLOAD, DELETE and TRANSFER on the FTP / SFTP server using REST API's.

    Our API lets you control nearly all aspects of your FTP / SFTP server operations programmatically, from uploading and downloading files to transferring and deletions based on GET, POST and DELETE operations.

    To POST files into the FTP / SFTP server, or to GET / DELETE files from the FTP / SFTP server, you will need some basic details like: username, password, port, and host URL to log in on the FTP / SFTP server. The REST API uses plain JSON over HTTP.

    This guide contains all info about how files can be imported, exported and deleted from FTP / SFTP Server using FTP API.

    Go Ahead...


    Note: We are not asking/storing any information on this website.

    Authentication

    Use this API to check if your FTP / SFTP server is accessible over the Internet.

    If you have set up an FTP / SFTP server you can use this API to check that FTP / SFTP Server is responding to our APIs or not.

    This API will try to connect to the FTP / SFTP server using your FTP / SFTP server credentials which you provided in HTTP Header. If the handshake gets success with the FTP / SFTP server, It will return a success response. If there are any problems along the way, the API will return a response which tells what's wrong and information which you need to correct.

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type ftp Required (Available Options : FTP OR SFTP, Default : FTP)

    Example Request

    curl https://www.ftp-api.com/ftp/checkconnection
    -H "Content-Type: application/json"
    -H "username: ftpserver"
    -H "password: ftpserver"
    -H "port: ftpserver"
    -H "ftp-host: ftpserver"
    -H "ftp-type: FTP"
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "FTP Server Connected Successfully!",
      "Code": 200
    }
    
    
                

    Use this API to check if your FTP / SFTP server is accessible over the Internet.

    If you have set up an FTP / SFTP server you can use this API to check that FTP / SFTP Server is responding to our APIs or not.

    This API will try to connect to the FTP / SFTP server using your FTP / SFTP server credentials which you provided in HTTP Header. If the handshake gets success with the FTP / SFTP server, It will return a success response. If there are any problems along the way, the API will return a response which tells what's wrong and information which you need to correct.

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Upload File

    This API allow us to upload files on FTP / SFTP Server. User can upload single or multiple files in a single API call.

    File object contains three parameters : path , filename and body. Body should be provided in Base64 encoding.

    HTTP Request

    POST https://www.ftp-api.com/ftp/upload

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    fileName sample.txt Required
    path sample Required, provide the FTP server directory, where you want to store the file
    body ftpserver Required, provide base64 encoded value

    Example Request

    curl https://www.ftp-api.com/ftp/upload
    -H "Content-Type: application/json"
    -H "username: ftpserver"
    -H "password: ftpserver"
    -H "port: ftpserver"
    -H "ftp-host: ftpserver"
    -H "ftp-type: FTP"
    -X POST
    -d '[{path:"/sample", fileName:"sample.txt", body:"sample"}]'
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "File upload successfully",
      "Code": 200
      "Files": [
    	  {
    	  "FileName": "sample.txt",
    	  "Path": "/sample",
    	  "body": "sample",
    	  "Status": "SUCCESS",
    	  "Message": "File Uploaded!",
    	  "Code": 200
    	  }
      ]
    }
    
    
                

    This API allow us to upload files on FTP / SFTP Server. User can upload single or multiple files in a single API call.

    File object contains three parameters : path , filename and body. Body should be provided in Base64 encoding.

    HTTP Request

    POST https://www.ftp-api.com/ftp/upload

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    fileName sample.txt Required
    path sample Required, provide the FTP server directory, where you want to store the file
    body ftpserver Required, provide base64 encoded value

    Delete File

    API to delete files on FTP / SFTP server. Specify the files to be deleted, by passing file-name and it's path on FTP / SFTP server.

    HTTP Request

    DELETE https://www.ftp-api.com/ftp/delete

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    fileName sample.txt Required
    path sample Required, provide the FTP server directory, where you want to store the file

    Example Request

    curl https://www.ftp-api.com/ftp/delete
    -H "Content-Type: application/json"
    -H "username: ftpserver"
    -H "password: ftpserver"
    -H "port: ftpserver"
    -H "ftp-host: ftpserver"
    -H "ftp-type: FTP"
    -X DELETE
    -d '[{path:"/sample", fileName:"sample.txt"}]'
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "Files deleted successfully!",
      "Code": 200
      "Files": [
    	  {
    	  "FileName": "sample.txt",
    	  "Path": "/sample",
    	  "Status": "SUCCESS",
    	  "Message": "File deleted successfully!",
    	  "Code": 200
    	  }
      ]
    }
    
    
                

    API to delete files on FTP / SFTP server. Specify the files to be deleted, by passing file-name and it's path on FTP / SFTP server.

    HTTP Request

    DELETE https://www.ftp-api.com/ftp/delete

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    fileName sample.txt Required
    path sample Required, provide the FTP server directory, where you want to store the file

    Download File

    API to download files from the FTP / SFTP server. This is a GET API. This operation can be performed in two ways, depending on the number of files you needed.

    First, the user can get all the files from the FTP / SFTP server.

    Second, the user can specify the files which are needed, so the API will return only the specified files. This API is further enhanced based on single or multiple files.

    Get All Files

    This API allows to download all the files in one single call.

    HTTP Request

    GET https://www.ftp-api.com/ftp/download

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)
    path ftpserver Optional
    StartDate 01/21/2020 Optional
    EndDate 01/31/2020 Optional
    StartDateTime 01/21/2020 11:24:00 Optional
    EndDateTime 01/31/2020 23:58:00 Optional

    Example Request

    curl https://www.ftp-api.com/ftp/download
    -H "Content-Type: application/json"
    -H "username: ftpserver"
    -H "password: ftpserver"
    -H "port: ftpserver"
    -H "ftp-host: ftpserver"
    -H "ftp-type: FTP"
    -X GET
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "File download successfully!",
      "Code": 200
      "Files": [
    	  {
    	  "FileName": "sample.txt",
    	  "Path": "/sample",
    	  "body": "base64Content",
    	  "LastModifiedDateTime": 1584509851000,
    	  "Status": "SUCCESS",
    	  "Message": "File download successfully!",
    	  "Code": 200
    	  }
      ]
    }
    
    
                

    Note: LastModifiedDateTime value in milliseconds.

    This API allows to download all the files in one single call.

    HTTP Request

    GET https://www.ftp-api.com/ftp/download

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)
    path ftpserver Optional
    StartDate 01/21/2020 Optional
    EndDate 01/31/2020 Optional
    StartDateTime 01/21/2020 11:24:00 Optional
    EndDateTime 01/31/2020 23:58:00 Optional

    Get a Specific File

    This API takes the file-name as a query parameter and returns the specified file.

    HTTP Request

    GET https://www.ftp-api.com/ftp/download?fileName=sample.txt

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)
    path /sample Required

    Example Request

    curl https://www.ftp-api.com/ftp/download?fileName=sample.txt
    -H "Content-Type: application/json"
    -H "username: ftpserver"
    -H "password: ftpserver"
    -H "port: ftpserver"
    -H "ftp-host: ftpserver"
    -H "ftp-type: FTP"
    -H "path: /sample"
    -X GET
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "File download successfully!",
      "Code": 200
      "Files": [
    	  {
    	  "FileName": "sample.txt",
    	  "Path": "/sample",
    	  "body": "base64Content",
    	  "LastModifiedDateTime": 1584509851000,
    	  "Status": "SUCCESS",
    	  "Message": "File download successfully!",
    	  "Code": 200
    	  }
      ]
    }
    
    
                

    Note: LastModifiedDateTime value in milliseconds.

    This API takes the file-name as a query parameter and returns the specified file.

    HTTP Request

    GET https://www.ftp-api.com/ftp/download?fileName=sample.txt

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)
    path /sample Required

    Get Multiple Specific File

    Specify the files to be downloaded in POST parameter and this API will return the data of those specified files.

    HTTP Request

    POST https://www.ftp-api.com/ftp/download

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    fileName sample.txt Required
    path sample Required, provide the FTP server directory, where you store the file

    Example Request

    curl https://www.ftp-api.com/ftp/download
    -H "Content-Type: application/json"
    -H "username: ftpserver"
    -H "password: ftpserver"
    -H "port: ftpserver"
    -H "ftp-host: ftpserver"
    -H "ftp-type: FTP"
    -H "path: /sample"
    -X POST
    -d '[{path:"/sample",fileName:"sample.txt"}]'
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "File download successfully!",
      "Code": 200
      "Files": [
    	  {
    	  "FileName": "sample.txt",
    	  "Path": "/sample",
    	  "body": "base64Content",
    	  "LastModifiedDateTime": 1584509851000,
    	  "Status": "SUCCESS",
    	  "Message": "File download successfully!",
    	  "Code": 200
    	  }
      ]
    }
    
    <

    Note: LastModifiedDateTime value in milliseconds.

    Specify the files to be downloaded in POST parameter and this API will return the data of those specified files.

    HTTP Request

    POST https://www.ftp-api.com/ftp/download

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    username ftpserver Required
    password ftpserver Required
    port ftpserver Required
    ftp-host ftpserver Required
    ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    fileName sample.txt Required
    path sample Required, provide the FTP server directory, where you store the file

    Transfer File

    This API allows user to transfer multiple files from one FTP / SFTP server to another FTP / SFTP server without downloading files.

    This API requires both source and destination FTP / SFTP server authentication.

    HTTP Request

    POST https://www.ftp-api.com/ftp/transfer

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    source-username ftpserver Required
    source-password ftpserver Required
    source-port ftpserver Required
    source-ftp-host ftpserver Required
    source-ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)
    target-username ftpserver Required
    target-password ftpserver Required
    target-port ftpserver Required
    target-ftp-host ftpserver Required
    target-ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    source_path sample.txt Required, provide the FTP server directory, from where you want to get the file
    source_file_Name sample Required
    target_path sample.txt Required, provide the FTP server directory, where you want to store the file
    target_file_Name sample Required

    Example Request

    curl https://www.ftp-api.com/ftp/transfer
    -H "Content-Type: application/json"
    -H "source-ftp-host: ftpserver"
    -H "source-username: ftpserver"
    -H "source-password: ftpserver"
    -H "source-port: ftpserver"
    -H "source-ftp-type: FTP"
    -H "target-ftp-host: ftpserver"
    -H "target-username: ftpserver"
    -H "target-password: ftpserver"
    -H "target-port: ftpserver"
    -H "target-ftp-type: FTP"
    -X POST
    -d '[{"source_path":"/sample","source_file_Name":"sample.txt",'
    	 "target_path":"/sample","target_file_Name":"sample.txt"}]'
    
    
                

    Make sure to replace ftpserver with your ftp server credentails.

    Example Response

    {
      "Status": "SUCCESS",
      "Message": "Files transfer completed!",
      "Code": 200
      "Files": [
    	  {
    	  "FileName": "sample.txt",
    	  "Path": "/sample",
    	  "Status": "SUCCESS",
    	  "Message": "File Uploaded!",
    	  "Code": 200
    	  }
      ]
    }
    
    <

    This API allows user to transfer multiple files from one FTP / SFTP server to another FTP / SFTP server without downloading files.

    This API requires both source and destination FTP / SFTP server authentication.

    HTTP Request

    POST https://www.ftp-api.com/ftp/transfer

    Header Parameters

    Following parameters should be included in the request header.

    Parameter Value Optional/Required
    Content-Type application/json Required
    source-username ftpserver Required
    source-password ftpserver Required
    source-port ftpserver Required
    source-ftp-host ftpserver Required
    source-ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)
    target-username ftpserver Required
    target-password ftpserver Required
    target-port ftpserver Required
    target-ftp-host ftpserver Required
    target-ftp-type FTP Required (Available Options : FTP OR SFTP, Default : FTP)

    Request Body Parameters

    Following parameters should be included in the request body.

    Parameter Value Description
    source_path sample.txt Required, provide the FTP server directory, from where you want to get the file
    source_file_Name sample Required
    target_path sample.txt Required, provide the FTP server directory, where you want to store the file
    target_file_Name sample Required