Logo

How can we help?

Get answers to your questions right here...

SFTP Gateway 2.0 admin API

SFTP Gateway 2.0

SFTP Gateway 2.0 admin API

Last updated on 15 May, 2019

Admin API for user management, system configuration, and diagnostics.

Login [/backend/login]

Login [POST]

Use the Bearer token in the response headers for further authenticated requests.

  • Request

    • Headers

        Content-Type: application/json
    • Body

        {    "username": "value",    "password": "value"}
  • Response 200

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
  • Response 403

    • Headers

        Content-Length: 0

Users List [/backend/api/users{?search}]

List all users [GET]

  • Parameters

    • search (string, optional) - A query variable to search for users by username

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
  • Response 200

    • Headers

        Content-Type: application/json
    • Body

        {    "users":         [            {                "username": "value",                "bucketName": "value",                "path": "value",                "s3EncryptionLevel": "value",                "pubSsh": "value",                "downloadDir": "value",                "sharedDir": "value",                "uidNumber": "value"            }        ]}

Create user [POST]

  • Attributes

    • username (string) - Required

    • bucketName (string) - If not supplied, system’s default bucket will be the default value

    • path (string) - If not supplied, username will be the default value (ex: /alice)

    • pubSsh (string) - Public SSH key

    • s3EncryptionLevel (string) - Id of the encryption key, if nothing is provided the default is SSE-S3. Values can be “1” (SSE-S3 encryption); “4” (no encryption); “A KMS key arn” (encryption will be handled by a predefined KMS key)

    • downloadDir (boolean) - Enables user access to a private download directory. Values cab be “TRUE” or “FALSE

    • sharedDir (boolean) - Enables user access to the shared directory. Values can be “TRUE” or “FALSE”

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer token
    • Body

        {    "username": "value",    "bucketName": "",    "path": "",    "pubSsh": "",    "s3EncryptionLevel": "",    "downloadDir": "",    "sharedDir": ""}
  • Response 201

    • Headers

        Content-Length: 0
  • Response 400

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "Bad Request"}
  • Response 409

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "Entry Already Exists"}

Get user [GET /backend/api/users/{username}]

  • Parameters

    • username (string)

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
  • Response 200

    • Headers

        Content-Type: application/json
    • Body

        {    "username": "value",    "bucketName": "value",    "path": "value",    "s3EncryptionLevel": "value",    "pubSsh": "value",    "downloadDir": "value",    "sharedDir": "value",    "uidNumber": "value"}
  • Response 404

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "No Such Object"}

Update user [PUT /backend/api/users/{username}{?force-create}]

  • Parameters

    • username (string)

    • force-create (boolean, optional) - A request param variable to create the user in case they do not exist. Value can be true or false.

  • Attributes

    • username (string) - Required

    • bucketName (string) - If not supplied, system’s default bucket will be the default value

    • path (string) - If not supplied, username will be the default value (ex: /alice)

    • pubSsh (string) - Public SSH ke

    • s3EncryptionLevel (string) - Id of the encryption key, if nothing is provided the default is SSE-S3. Values can be “1” (SSE-S3 encryption); “4” (no encryption); “A KMS key arn” (encryption will be handled by a predefined KMS key)

    • downloadDir (boolean) - Enables user access to a private download directory. Value cab be “TRUE” or “FALSE

    • sharedDir (boolean) - Enables user access to the shared directory. Value can be “TRUE” or “FALSE”

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
    • Body

        {    "bucketName": "",    "path": "",    "pubSsh": "",    "s3EncryptionLevel": "",    "downloadDir": "",    "sharedDir": ""}
  • Response 200

    • Headers

        Content-Length: 0
  • Response 400

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "Bad Request"}
  • Response 404

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "No Such Object"}

Delete user [DELETE /backend/api/users/{username}]

  • Parameters

    • username (string)

  • Request

    • Headers

        Authorization: Bearer Token
  • Response 204

  • Response 404

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "No Such Object"}

S3 Encryption Levels [/backend/api/s3encryption]

List all levels [GET]

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
  • Response 200

    • Headers

        Content-Type: application/json
    • Body

        {    "s3Encryption":         [            {                "alias": "value",                "keyArn": "value",                "keyId": "value"            }        ]}

System Configuration [/backend/api/configuration]

Get system configuration [GET]

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
  • Response 200

    • Headers

        Content-Type: application/json
    • Body

        {    "bucketName": "value",    "sharedPath": "value",    "uploadPath": "value"}

Update system configuration [PUT]

  • Attributes

    • bucketName (string) - If not supplied, system’s default bucket will be the default value

    • sharedPath (string) - If not supplied, system’s default “shared” path will be the default value

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
    • Body

        {    "bucketName": "value",    "sharedPath": "value"}
  • Response 200

    • Headers

        Content-Type: application/json
  • Response 400

    • Headers

        Content-Type: application/json
    • Body

        {    "message": "Bad Request"}

SSH key pair generator [/backend/api/keypair/generate]

Generate ssh keys [GET]

  • Request

    • Headers

        Authorization: Bearer Token
  • Response 200

    • Headers

        Content-Type: application/json
    • Body

        {    "privateKey": "value",    "publicKey": "value"}

Diagnostics [/diagnostics]

GET system diagnostics [GET]

  • Request

    • Headers

        Content-Type: application/jsonAuthorization: Bearer Token
  • Response 200

    • Headers

        Content-Type: application/json
    • Body

        {    "logFiles":         [            {                "fileName": "value",                "fileContents": "value"            }        ]}
Did you find this article helpful?
Previous

SFTP Gateway 2.0 Command Line Interface Overview

Next