Requesting Metadata
All entries in the Drive have metadata that is accessible using this handler. It also serves the purpose of browsing the folder and file structure in the Drive. To download or manipulate the content of a specific path or Drive ID you can use the /api/drive/content handler.
Drive entries are addressed either by their Drive ID or by their path.
GET /api/drive/meta/<Path ID>
Request metadata information for the given <Path ID>
. If left empty, metadata information of the RootID
- the Drive's file root - is returned.
RESPONSE Fields | Value Type | Description |
---|---|---|
id |
string | The Drive ID that can be used for addressing this entry directly |
name |
string | The file name of this Drive entry |
type |
string | The kind of Drive entries. It can be one of: |
ROOT : The Drive root or a mount root element |
||
HOME : The current user's home directory |
||
FOLDER : A directory in the Drive |
||
CONTENT : A file in the current directory of the Drive |
||
path |
string | The absolute path of the Drive element |
lastModified |
number | The timestamp of the last modification of the current drive element. |
contentHref |
string | The encoded URL to get or modify the content of the drive element. |
metaData |
map | A map of metadata properties that is volatile and may change depending on the type of the Drive entry. |
children |
array | A list of sub-entries if the current Drive entry is one of the FOLDER types. The sub entries are again a metadata listing similar to the current Drive entry. Sub-entries will have neither the metaData nor listing fields. You can get these fields by requesting the sub-entry using its path or Drive ID. |
Example Request: Root ID
Requesting metadata information from the root of the Drive.
# Request # Use user:password for authorization GET /api/drive/meta HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Response - A list of Drive roots HTTP/1.1 200 OK Content-Type: application/json Content-Length: <CONTENT LENGTH> { "id": "RootID", "name": "Drive", "type": "ROOT", "path": "/", "lastModified": 1715149552752, "contentHref": "http://myserver/api/drive/content/RootID", "metaData": { "creator": "PrivilegedAccount", "created": 1715149552752, "modifiedBy": "PrivilegedAccount" }, "children": [ { "id": "e9rsmp7vte38ux572x41okmmd", "name": "Home", "type": "HOME", "lastModified": 1715149649879, "contentHref": "http://myserver/api/drive/content/e9rsmp7vte38ux572x41okmmd" }, { "id": "2x4bikp8j1p18nljl3weyw3y7", "name": "application", "type": "FOLDER", "lastModified": 1715149649788, "contentHref": "http://myserver/api/drive/content/2x4bikp8j1p18nljl3weyw3y7" }, { "id": "a2f2as7j6iznqo2d3m9o31jj2", "name": "testfile.pdf", "type": "CONTENT", "lastModified": 1715174042487, "contentHref": "http://myserver/api/drive/content/a2f2as7j6iznqo2d3m9o31jj2" }, ... ] }
Example Request: Folder Entry
Requesting metadata information from a folder entry of the Drive. You can either use the Drive entries ID or the path.
Note: Since we are requesting information from the Drive's root, we can omit RootID
prefix.
# Request # Use user:password for authorization GET /api/drive/meta/2x4bikp8j1p18nljl3weyw3y7 HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Alternatively use: # GET /api/drive/meta/application HTTP/1.1 # GET /api/drive/meta/RootID/2x4bikp8j1p18nljl3weyw3y7 HTTP/1.1 # GET /api/drive/meta/RootID/application HTTP/1.1 # Response - A list of Drive roots HTTP/1.1 200 OK Content-Type: application/json Content-Length: <CONTENT LENGTH> { "id": "2x4bikp8j1p18nljl3weyw3y7", "name": "application", "type": "FOLDER", "path": "/application/", "lastModified": 1715149649788, "contentHref": "http://myserver/api/drive/content/e9rsmp7vte38ux572x41okmmd", "metaData": { "creator": "PrivilegedAccount", "created": 1715149552752, "modifiedBy": "PrivilegedAccount" }, "children": [ ... ] }
Example Request: Content Entry
Requesting metadata information from a content entry ID of the Drive. You can either use the Drive entries ID or the path.
Note: Since we are requesting information from the Drive's root, we can omit RootID
prefix.
# Request # Use user:password for authorization GET /api/drive/meta/f3n8orcby9w4zrhyeuhuhgrgt HTTP/1.1 Authorization: Bearer VGhpcyBpcyBqdXN0IGEgZGVtbyBhY2Nlc3MgdG9rZW4u # Alternatively use: # GET /api/drive/meta/application/customerprofilereport.rpt HTTP/1.1 # GET /api/drive/meta/RootID/f3n8orcby9w4zrhyeuhuhgrgt HTTP/1.1 # GET /api/drive/meta/RootID/application/customerprofilereport.rpt HTTP/1.1 # Response - The metadata of the Drive entry HTTP/1.1 200 OK Content-Type: application/json Content-Length: <CONTENT LENGTH> { "id": "f3n8orcby9w4zrhyeuhuhgrgt", "name": "customerprofilereport.rpt", "type": "CONTENT", "path": "/application/customerprofilereport.rpt", "lastModified": 1715149649819, "contentHref": "http://myserver/api/drive/content/f3n8orcby9w4zrhyeuhuhgrgt", "metaData": { "creator": "PrivilegedAccount", "created": 1715149552752, "modifiedBy": "PrivilegedAccount", "size": "984312", "title": "Customer Profiles", "filetype": "rpt", "author": "i-net software" } }