This endpoint mimics the Node API, allowing shares to be accessed as if they are nodes. The methods support basic auth credentials in the Authorization header in addition to the Shares access tokens required by the rest of the application.

Request Headers

Content-Type: application/json
Accept: application/json
Authorization: Bearer access_token
Host: example.org
Cookie: 

Request Body Format

{"path":"/org/project/share/path/to/directory","skip":5,"count":5}

Request Example

curl "http://shares.example.com/node_api/files/browse" -d '{"path":"/org/project/share/path/to/directory","skip":5,"count":5}' -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer access_token" \
-H "Host: example.org" \
-H "Cookie: "

Request Parameters

Name Required/Optional Type Description
path Required string Path to browse (/<org name>/<project name>/<share_name>/path/on/share)
count Optional unsigned integer Number of items to return
skip Optional unsigned integer Number of items to skip

Success Response Code

200 OK

Response Headers

X-Frame-Options: SAMEORIGIN
         X-XSS-Protection: 1; mode=block
         X-Content-Type-Options: nosniff
         Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
         Content-Type: application/json; charset=utf-8
         ETag: W/"e5444dd8e40804e7044462e560d9b01d"
         Cache-Control: max-age=0, private, must-revalidate
         X-Request-Id: 063c496b-dfd3-4410-826d-eb1f0857bbee
         X-Runtime: 0.233353
         Content-Length: 1520

Response Attributes

Name Type Description
name string API name

Create a file

POST /node_api/files/create

Success Response

200 OK
{
  "paths": [
    {
      "path": "/org/project/share/path/to/new_item"
    },
    {
      "path": "/org/project/share/path/to/existing_item",
      "error": {
        "code": 409,
        "reason": "Conflict",
        "user_message": "Path already exists"
      }
    }
  ]
}


Rename a file

POST /node_api/files/rename

Request Example

curl "http://shares.example.com/node_api/files/rename" -d '{"paths":[{"path":"/org/project/share/path/to/","source":"new_item","destination":"renamed_item"},{"path":"/org/project/share/path/to/","source":"missing_item","destination":"renamed_missing_item"}]}' -X POST

Success Response

200 OK

{
    "paths": [
    {
      "path": "/org/project/share/path/to",
      "source": "new_item",
      "destination": "renamed_item"
    },
    {
      "path": "/org/project/share/path/to",
      "source": "missing_item",
      "destination": "renamed_missing_item",
      "error": {
        "code": 404,
        "reason": "Not Found",
        "user_message": "No such file or directory"
      }
    }
    ]
    }


Delete a file

POST /node_api/files/delete

Request Example

curl "http://shares.example.com/node_api/files/delete" -d '{"paths":[{"path":"/org/project/share/path/to/renamed_item"},{"path":"/org/project/share/path/to/missing_item"}]}' -X POST

Success Response

200 OK

{
  "paths": [
    {
      "path": "/org/project/share/path/to/renamed_item"
    },
    {
      "path": "/org/project/share/path/to/missing_item",
      "error": {
        "code": 404,
        "reason": "Not Found",
        "user_message": "No such file or directory"
      }
    }
  ]
}


Browse a share

POST /node_api/files/browse

Request Example

curl "http://shares.example.com/node_api/files/browse" -d '{"path":"/org/project/share/path/to/directory","skip":5,"count":5}' -X POST \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer JxiXJGZrCCNcNANJDzx1rTp25ch5ciYwraP5J809ti0" \
	-H "Host: example.org" \
	-H "Cookie: "

Response Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
Content-Type: application/json; charset=utf-8
ETag: W/"e5444dd8e40804e7044462e560d9b01d"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: c0c9ca2e-9883-4fe5-9e85-7bbab460281c
X-Runtime: 0.301571
Content-Length: 1520

Success Response

200 OK
{
    "self": {
    "path": "/org/project/share/path/to/directory",
    "basename": "directory",
    "type": "directory",
    "size": 0,
    "mtime": "2017-04-12T20:53:31Z",
    "permissions": [
      {
        "name": "view"
      },
      {
        "name": "read"
      },
      {
        "name": "write"
      },
      {
        "name": "delete"
      },
      {
        "name": "rename"
      },
      {
        "name": "mkdir"
      }
    ]
    },
    "items": [
    {
      "path": "/org/project/share/path/to/directory/file6",
      "basename": "file6",
      "type": "file",
      "size": 8,
      "mtime": "2017-04-12T20:53:20Z",
      "permissions": [
        {
          "name": "view"
        },
        {
          "name": "read"
        },
        {
          "name": "write"
        },
        {
          "name": "delete"
        },
        {
          "name": "rename"
        }
      ]
    },
    {
      "path": "/org/project/share/path/to/directory/file7",
      "basename": "file7",
      "type": "file",
      "size": 8,
      "mtime": "2017-04-12T20:53:22Z",
      "permissions": [
        {
          "name": "view"
        },
        {
          "name": "read"
        },
        {
          "name": "write"
        },
        {
          "name": "delete"
        },
        {
          "name": "rename"
        }
      ]
    },
    "item_count": 5,
    "total_count": 11,
    "parameters": {
    "path": "/org/project/share/path/to/directory",
    "skip": 5,
    "count": 5
    }
    }


Get API info

GET /node_api

This method returns an /"apis/" object which contains an array of API data.

Request Example

curl -g "http://shares.example.com/node_api" -X GET

Success Response

200 OK

{
  "apis": [
    {
      "name": "node",
      "version": 2,
      "url": "http://example.org/node_api"
    }
  ]
}


Get application info (unauthenticated)

GET /node_api/app

This method returns application information.

Request Headers

Content-Type: application/json
Accept: application/json
Authorization:
Host: example.org
Cookie: 

Request Example

curl -g "http://shares.example.com/node_api/app" -X GET

Success Response

200 OK
{
  "application": "shares2",
  "version": "0.0.0.0.0",
  "login_url": "http://example.org/session/new",
  "app_login_url": "http://example.org/session/new?aspera_app=true"
}


Get file info

POST /node_api/files/info

This method returns file information.

Request Example

curl "http://shares.example.com/node_api/files/info" -d '{"paths":[{"path":"/org/project/share/path/to/item"},{"path":"/org/project/share/path/to/missing_item"}]}' -X POST

Success Response

200 OK

{
  "paths": [
    {
      "path": "/org/project/share/path/to/item",
      "basename": "item",
      "type": "file",
      "size": 8,
      "mtime": "2017-04-12T22:47:26Z",
      "permissions": [
        {
          "name": "view"
        },
        {
          "name": "read"
        },
        {
          "name": "write"
        },
        {
          "name": "delete"
        },
        {
          "name": "rename"
        }
      ]
    },
    {
      "path": "/org/project/share/path/to/missing_item",
      "error": {
        "code": 404,
        "reason": "Not Found",
        "user_message": "Path not found"
      }
    }
  ]
}


Initiate a transfer

POST /node_api/ops/transfers

This endpoint initiates a transfer when given a transfer spec returned from Shares' upload_setup or download_setup endpoints. See the Node API documentation for more details. Note: This endpoint only supports transfer specs generated from Shares' upload_setup or download_setup endpoints.


Update a transfer

PUT /node_api/ops/transfers/{uuid}

This endpoint updates a transfer initiated by shares. See the Node API documentation for more details.

Perform download setup

POST /node_api/files/download_setup


Request Example

curl "http://shares.example.com/node_api/files/download_setup" -d '{"transfer_requests":[{"transfer_request":{"paths":[{"source":"/path/on/share"}],"source_root":"/org/project/share"}}]}' -X POST

Success Response

200 OK

{
  "transfer_specs": [
    {
      "transfer_spec": {
        "paths": [
          {
            "source": "/share_root/path/on/share"
          }
        ],
        "source_root": "",
        "destination_root": "",
        "token": "ATM2_ACsFAsRO_zjbcF2QFyq07Li_8Fkw3X_NfSN2CnVdT0V0DgAAEIBtqfluZ5jy0fyw1TOAUv_2MTA",
        "direction": "receive",
        "cipher": "aes-128",
        "tags": {
          "aspera": {
            "shares": {
              "user": "First_name_10 Last_name_10",
              "user_id": 891963376,
              "transfer_uuid": "3b48e3e3-3482-4ebf-b65c-090dbda42483",
              "source_share": "share",
              "source_share_id": 10
            }
          }
        },
        "rate_policy_allowed": "fixed",
        "rate_policy": "fair",
        "target_rate_kbps": 10000,
        "min_rate_kbps": 0,
        "remote_host": "10.0.153.64",
        "remote_user": "faspex",
        "sshfp": null,
        "ssh_port": 33001,
        "fasp_port": 33001,
        "http_fallback": true,
        "http_fallback_port": 8443,
        "authentication": "token"
      }
    }
  ]
}


Perform sync download setup

POST /node_api/files/sync_setup

Request Example

curl "http://shares.example.com/node_api/files/sync_setup" -d '{"transfer_requests":[{"transfer_request":{"type":"sync_download","paths":[{"source":"/path/on/share","destination":"/path/to/destination"}],"source_root":"/org/project/share"}}]}' -X POST

Success Response

200 OK
{
  "transfer_specs": [
    {
      "transfer_spec": {
        "paths": [
          {
            "source": "/path/on/share",
            "destination": "/path/to/destination"
          }
        ],
        "type": "sync_download",
        "source_root": "/share_root",
        "destination_root": "",
        "token": "ATM2_ACs2CBrlkMQuJ9lppffsldynd_vd-Dd9FP8AxPCk9xvCWwAAGRRgOXofAvC-KreeSRMq5-_2MTA",
        "direction": "receive",
        "cipher": "aes-128",
        "tags": null,
        "rate_policy_allowed": "fixed",
        "rate_policy": "fair",
        "target_rate_kbps": 10000,
        "min_rate_kbps": 0,
        "remote_host": "10.0.153.64",
        "remote_user": "faspex",
        "sshfp": null,
        "ssh_port": 33001,
        "fasp_port": 33001,
        "http_fallback": true,
        "http_fallback_port": 8443
      }
    }
  ]
}


Perform upload setup

POST /node_api/files/upload_setup

Request Example

curl "http://shares.example.com/node_api/files/upload_setup" -d '{"transfer_requests":[{"transfer_request":{"paths":[{"destination":"/path/on/share"}],"destination_root":"/org/project/share"}}]}' -X POST

Success Response

200 OK
{
  "transfer_specs": [
    {
      "transfer_spec": {
        "paths": [
          {
            "destination": "/share_root/path/on/share"
          }
        ],
        "source_root": "",
        "destination_root": "/share_root/path/on/share",
        "token": "ATM3_ACsWrekblr7AFFwWts54-MDYItE-0UHvOdSQfbBeP_h6OUAAE8YO5-gXmKHB_sGbAYkNdZ_3MTA",
        "direction": "send",
        "cipher": "aes-128",
        "tags": {
          "aspera": {
            "shares": {
              "user": "First_name_12 Last_name_12",
              "user_id": 891963376,
              "transfer_uuid": "676d9913-34e9-4c70-aa4f-6c0384ae78a2",
              "destination_share": "share",
              "destination_share_id": 12
            }
          }
        },
        "rate_policy_allowed": "fixed",
        "rate_policy": "fair",
        "target_rate_kbps": 10000,
        "min_rate_kbps": 0,
        "remote_host": "10.0.153.64",
        "remote_user": "faspex",
        "sshfp": null,
        "ssh_port": 33001,
        "fasp_port": 33001,
        "http_fallback": true,
        "http_fallback_port": 8443,
        "authentication": "token"
      }
    }
  ]
}


Ping application

GET /node_api/ping

Request Example

curl -g "http://shares.example.com/node_api/ping" -X GET

Success Response

200 OK


Query transfer info

GET /node_api/ops/transfers/{uuid}

This endpoint returns information about a transfer from a node for a transfer initiated by Shares. See the Node API documentation for details.


Retrieve info

GET /node_api/info

Request Example

curl -g "http://shares.example.com/node_api/info" -X GET

Success Response

200 OK
{
  "current_time": "2017-11-01T03:55:45.046Z",
  "application": "shares2",
  "version": "0.0.0.0.0",
  "capabilities": [
    {
      "name": "sync",
      "value": true
    },
    {
      "name": "move_file",
      "value": true
    }
  ]
}


Retrieve info with basic auth credentials

GET /node_api/info

Request Example

curl -g "http://shares.example.com/node_api/info" -X GET 

Success Response

200 OK
{
  "current_time": "2017-11-01T03:55:44.988Z",
  "application": "shares2",
  "version": "0.0.0.0.0",
  "capabilities": [
    {
      "name": "sync",
      "value": true
    },
    {
      "name": "move_file",
      "value": true
    }
  ]
}


Retrieve space info

POST /node_api/space

Request Example

curl "http://shares.example.com/node_api/space" -d '{"paths":[{"path":"/org/project/share/path/"}]}' -X POST

Success Response

200 OK

Example Response Body

{
  "paths": [
    {
      "path": "/org/project/share/path",
      "bytes_total": 14921236480,
      "bytes_free": 4301312000,
      "percent_free": 28.83
    }
  ]
}

Video player

Video

×