Drive

The Drive WebAPI provides access to entries in the drive. Users with the respective permission can view the metadata of drive entries, as well as download, upload and delete drive entries according to their permissions in the drive.

Commands

Additional Command Description
/drive Show a list of all available Drive roots or return a single root when a <Root ID> is provided
/drive/meta/<Path ID> Show a metadata listing of Drive entries in the selected path or Drive ID
/drive/content/<Path ID> Content download handler for selected path or Drive ID

GET /api/drive[/<Root ID>]

Request a list of all Drive roots that are available to the currently logged in user. A Drive root is defined by mounted services, with the Drive being the local file storage on the server. If a <Root ID> is provided, only the matching root is returned. Unknown root IDs return status 404.

Example Request

# Request
# Use user:password for authorization
GET /api/drive HTTP/1.1
Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u
 
# Response - A list of Drive roots for current user
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: <CONTENT LENGTH>
 
{
  "Drive": "Drive",
  ...
}

Requesting a single root by ID returns only that root.

# Request
# Use user:password for authorization
GET /api/drive/Drive HTTP/1.1
Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u
 
# Response - The selected Drive root
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: <CONTENT LENGTH>
 
{
  "Drive": "Drive"
}

Application Example

# Shell access using curl
curl -X GET -LsH "Authorization: Bearer <access_token>" "http://127.0.0.1:9000/api/drive"
 
# Shell access using curl using username and password
curl -X GET -Lsu username:password "http://127.0.0.1:9000/api/drive"
 
# Request a single root by ID
curl -X GET -LsH "Authorization: Bearer <access_token>" "http://127.0.0.1:9000/api/drive/Drive"