Index

Maytech APIs

Looking to integrate with a Maytech product? We've got everything you need in this guide. Code samples, detailed API documentation, notes and tips that will help you to start in no time.


API endpoint

To perform FTP-Stream API client application should send api_key. You can obtain api_key on FTP-Stream Control Panel visting your FTP-Stream account 'Site Properties' tab.

URL: https://www.maytech.net/panel/api/<api-version>/<route>[/<action>][/<object-id>]?api_key=<api_key>[&optional_get_parameters]

  • <api-version> - API Version. Current version is 1.0
  • <route> - FTP-Stream API route.
  • <action> - FTP-Stream API action.
  • <object-id> - universally unique FTP-Stream object identifier.
  • <api_key> - FTP-Stream API key.
  • <optional_get_parameters> - optional request parameters

Example request/response

Request

GET https://www.maytech.net/panel/api/1.0/user/00000000-0000-0000-0000-000000000000/?api_key=12345678-0000-0000-0000-000000000000&fields=login,real_name

Response

HTTP/1.1 200 OK
Content-Type: application/json

{"status":"OK","data":{"login":"demo","real_name":"John Smith"}}

FTP-Stream Objects

  1. User ID object representing FTP-Stream User ID:

    {
      "uuid": "00000000-0000-0000-0000-000000000000",
      "login": "demo",
      "password": "demopassword",
      "real_name": "John Smith",
      "homedir": "\/demo",
      "expire_time": "1414150244",
      "bytes_in_avail": "0",
      "admin": "Y",
      "active": "Y",
      "lockedout": "N",
      "ftp_active": "Y",
      "ftps_active": "Y",
      "ftp_filelist": "Y",
      "ftp_download": "Y",
      "ftp_upload": "Y",
      "ftp_overwrite": "Y",
      "ftp_delete": "Y",
      "sftp_active": "Y",
      "sftp_filelist": "Y",
      "sftp_download": "Y",
      "sftp_upload": "Y",
      "sftp_overwrite": "Y",
      "sftp_delete": "Y",
      "http_active": "Y",
      "https_active": "Y",
      "web_filelist": "Y",
      "web_download": "Y",
      "web_upload": "Y",
      "web_overwrite": "Y",
      "web_delete": "Y",
      "web_manage": "Y",
      "web_media": "Y",
      "web_notification": "Y",
      "email": "john.smith@example.com",
      "recover_email": null,
      "passwordless_link": "http:\/\/demo.ftpstream.com\/?lid=<random_string>",
      "secure_passwordless_link": "https:\/\/demo.ftpstream.com\/?lid=<random_string>"
    }

    • <uuid> - universally unique User ID identifier. Read only.
    • <login> * - User ID login used for file access. Unique. 3-20 lower/upper case characters or numbers. Required.
    • <password> * - User ID password used for file access. Password should be between 6 to 25 any characters except spaces. Password can not be same as login. Required.
    • <real_name> * - User ID real name. Required.
    • <homedir> * - User ID home directory. Required.
    • <expire_time> - User ID expiration time. Seconds scince 1 January 1970. Default 1 January 2100.
    • <bytes_in_avail> - User ID disc space limit in bytes. Default 0 - no limit.
    • <admin> - Flag which grants admin rights to User ID. Values 'Y' or 'N'. Default 'N'.
    • <active> - Flag which indicates whether User ID active. Values 'Y' or 'N'. Default 'Y'.
    • <recover_email> - User ID email used for password recovery. Works only with Enhanced Security optional module.
    • <lockedout> - Flag which indicates whether User ID lockedout. Values 'Y' or 'N'. Default 'N'.
    • <ftp_active> - Flag to enable FTP protocol for User ID. Values 'Y' or 'N'. Default 'Y'.
    • <ftps_active> - Flag to enable FTPS protocol for User ID. Values 'Y' or 'N'. Default 'Y'.
    • <ftp_filelist> - Flag to allow FTP/FTPS filelisting. Values 'Y' or 'N'. Default 'Y'.
    • <ftp_download> - Flag to allow FTP/FTPS download. Values 'Y' or 'N'. Default 'Y'.
    • <ftp_upload> - Flag to allow FTP/FTPS upload. Values 'Y' or 'N'. Default 'Y'.
    • <ftp_overwrite> - Flag to allow FTP/FTPS file overwrite during upload. Values 'Y' or 'N'. Default 'Y'.
    • <ftp_delete> - Flag to allow FTP/FTPS file delete. Values 'Y' or 'N'. Default 'Y'.
    • <sftp_active> - Flag to enable SFTP protocol for User ID. Values 'Y' or 'N'. Default 'Y'.
    • <sftp_filelist> - Flag to allow SFTP filelisting. Values 'Y' or 'N'. Default 'Y'.
    • <sftp_download> - Flag to allow SFTP download. Values 'Y' or 'N'. Default 'Y'.
    • <sftp_upload> - Flag to allow SFTP upload. Values 'Y' or 'N'. Default 'Y'.
    • <sftp_overwrite> - Flag to allow SFTP file overwrite during upload. Values 'Y' or 'N'. Default 'Y'.
    • <sftp_delete> - Flag to allow SFTP file delete. Values 'Y' or 'N'. Default 'Y'.
    • <http_active> - Flag to enable web HTTP protocol for User ID. Values 'Y' or 'N'. Default 'Y'.
    • <https_active> - Flag to enable web HTTPS protocol for User ID. Values 'Y' or 'N'. Default 'Y'.
    • <web_filelist> - Flag to allow web filelisting. Values 'Y' or 'N'. Default 'Y'.
    • <web_download> - Flag to allow web download. Values 'Y' or 'N'. Default 'Y'.
    • <web_upload> - Flag to allow web upload. Values 'Y' or 'N'. Default 'Y'.
    • <web_overwrite> - Flag to allow web file overwrite during upload. Values 'Y' or 'N'. Default 'Y'.
    • <web_delete> - Flag to allow web file delete. Values 'Y' or 'N'. Default 'Y'.
    • <web_manage> - Flag to grant web file management functions. Values 'Y' or 'N'. Default 'Y'.
    • <web_media> - Flag to grant web video functions. Values 'Y' or 'N'. Default 'N'. Video available only with Video optional module.
    • <web_notification> - Flag to enable email advice on web upload. Default 'N'.
    • <email> - Email address for upload advices.
    • <passwordless_link> - User ID passwordless web link. Read only.
    • <secure_passwordless_link> - User ID passwordless secure web link. Read only.

User ID Methods

Request endpoint:

/api/1.0/user

GET - returns the list of all User ID

POST - inserts a new User ID

/api/1.0/user/<uuid>

GET - returns information on the particular User ID

PUT - update User ID

DELETE - delete a User ID


User ID Methods examples


get

Retrieve User ID

Request

GET https://www.maytech.net/panel/api/1.0/user/<uuid>/?api_key=12345678-0000-0000-0000-000000000000&fields=login,real_name

<uuid> - User ID unique identifier

Optional parameters

fields - Allows to obtain only specified User ID fields

Response

  • 200 - OK
  • 400 - Bad request
  • 401 - Invalid api_key
  • 500 - Internal Server Error
HTTP/1.1 200 OK
Content-Type: application/json

{"status":"OK","data":{"login":"demo","real_name":"John Smith"}}
HTTP/1.1 400 Bad Request
Content-Type: application/json

  {"status":"ERROR","message":"User record not found or API key owner have no access to User record."}

getall

Retrieve list of User IDs

Request

GET https://www.maytech.net/panel/api/1.0/user/?api_key=12345678-0000-0000-0000-000000000000&fields=login,real_name

Optional parameters

fields - Allows to obtain only specified User ID fields

Response

  • 200 - OK
  • 400 - Bad request
  • 401 - Invalid api_key
  • 500 - Internal Server Error
HTTP/1.1 200 OK
Content-Type: application/json

{"status":"OK","data":[{"login":"demo","real_name":"John Smith"},{"login":"demo2","real_name":"John Smith2"}]}

update

Update User ID

Request

PUT https://www.maytech.net/panel/api/1.0/user/<uuid>/?api_key=12345678-0000-0000-0000-000000000000
Content-Type: application/json

{"login":"demo2","real_name":"John Smith2"}

<uuid> - User ID unique identifier

Response

Returns full User ID record on success

  • 200 - OK
  • 400 - Bad request
  • 401 - Invalid api_key
  • 500 - Internal Server Error
HTTP/1.1 200 OK
Content-Type: application/json

{
  "status": "OK",
  "data": {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "login": "demo2",
    "password": "demopass",
    "real_name": "John Smith2",
    "homedir": "\/demo",
    "expire_time": "4102444800",
    "bytes_in_avail": "0",
    "admin": "N",
    "active": "Y",
    "lockedout": "N",
    "ftp_active": "Y",
    "ftps_active": "Y",
    "ftp_filelist": "Y",
    "ftp_download": "Y",
    "ftp_upload": "Y",
    "ftp_overwrite": "Y",
    "ftp_delete": "Y",
    "sftp_active": "Y",
    "sftp_filelist": "Y",
    "sftp_download": "Y",
    "sftp_upload": "Y",
    "sftp_overwrite": "Y",
    "sftp_delete": "Y",
    "http_active": "Y",
    "https_active": "Y",
    "web_filelist": "Y",
    "web_download": "Y",
    "web_upload": "Y",
    "web_overwrite": "Y",
    "web_delete": "Y",
    "web_manage": "Y",
    "web_media": "N",
    "web_notification": "Y",
    "email": null,
    "recover_email": null,
    "passwordless_link": "http:\/\/demo.ftpstream.com\/?lid=randomstring",
    "secure_passwordless_link": "https:\/\/demo.ftpstream.com\/?lid=randomstring"
  }
}

insert

Insert User ID

Request

POST https://www.maytech.net/panel/api/1.0/user/?api_key=12345678-0000-0000-0000-000000000000
Content-Type: application/json

{"login":"demo","password":"demopass","real_name":"John Smith","homedir":"\/demo"}

Response

Returns full User ID record on success

  • 200 - OK
  • 400 - Bad request
  • 401 - Invalid api_key
  • 500 - Internal Server Error
HTTP/1.1 200 OK
Content-Type: application/json

{
  "status": "OK",
  "data": {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "login": "demo",
    "password": "demopass",
    "real_name": "John Smith",
    "homedir": "\/demo",
    "expire_time": "4102444800",
    "bytes_in_avail": "0",
    "admin": "N",
    "active": "Y",
    "lockedout": "N",
    "ftp_active": "Y",
    "ftps_active": "Y",
    "ftp_filelist": "Y",
    "ftp_download": "Y",
    "ftp_upload": "Y",
    "ftp_overwrite": "Y",
    "ftp_delete": "Y",
    "sftp_active": "Y",
    "sftp_filelist": "Y",
    "sftp_download": "Y",
    "sftp_upload": "Y",
    "sftp_overwrite": "Y",
    "sftp_delete": "Y",
    "http_active": "Y",
    "https_active": "Y",
    "web_filelist": "Y",
    "web_download": "Y",
    "web_upload": "Y",
    "web_overwrite": "Y",
    "web_delete": "Y",
    "web_manage": "Y",
    "web_media": "N",
    "web_notification": "Y",
    "email": null,
    "recover_email": null,
    "passwordless_link": "http:\/\/demo.ftpstream.com\/?lid=randomstring",
    "secure_passwordless_link": "https:\/\/demo.ftpstream.com\/?lid=randomstring"
  }
}

delete

Delete User ID

Request

DELETE https://www.maytech.net/panel/api/1.0/user/<uuid>/?api_key=12345678-0000-0000-0000-000000000000

<uuid> - User ID unique identifier

Response

Returns deleted User ID record on success

  • 200 - OK
  • 400 - Bad request
  • 401 - Invalid api_key
  • 500 - Internal Server Error
HTTP/1.1 200 OK
Content-Type: application/json

{
  "status": "OK",
  "message":"Record deleted.",
  "data": {
    "uuid": "00000000-0000-0000-0000-000000000000",
    "login": "demo",
    "password": "demopass",
    "real_name": "John Smith",
    "homedir": "\/demo",
    "expire_time": "4102444800",
    "bytes_in_avail": "0",
    "admin": "N",
    "active": "Y",
    "lockedout": "N",
    "ftp_active": "Y",
    "ftps_active": "Y",
    "ftp_filelist": "Y",
    "ftp_download": "Y",
    "ftp_upload": "Y",
    "ftp_overwrite": "Y",
    "ftp_delete": "Y",
    "sftp_active": "Y",
    "sftp_filelist": "Y",
    "sftp_download": "Y",
    "sftp_upload": "Y",
    "sftp_overwrite": "Y",
    "sftp_delete": "Y",
    "http_active": "Y",
    "https_active": "Y",
    "web_filelist": "Y",
    "web_download": "Y",
    "web_upload": "Y",
    "web_overwrite": "Y",
    "web_delete": "Y",
    "web_manage": "Y",
    "web_media": "N",
    "web_notification": "Y",
    "email": null,
    "recover_email": null,
    "passwordless_link": "http:\/\/demo.ftpstream.com\/?lid=randomstring",
    "secure_passwordless_link": "https:\/\/demo.ftpstream.com\/?lid=randomstring"
  }
}

Help us make it better

Please tell us how we can make the APIs better. If you have a specific feature request or if you found a bug, please contact us: support@maytech.net