get https://example.com/nfs/directory//
Fetch a directory.
Only authorised requests can invoke this API.
Request Header
Authorization: Bearer <TOKEN>
Response
The API returns the metadata of the directory as well as the metadata of its files and subdirectories.
{
"info": {
"name": String,
"isPrivate": Boolean,
"createdOn": Long,
"modifiedOn": Long,
"metadata": base64 String
},
"files": [],
"subDirectories": []
}
Unauthorized
Fields are missing
Field | Description |
---|---|
info.name | Name of the directory. |
info.isPrivate | Whether the directory is private or not. |
info.createdOn | Created timestamp. |
info.modifiedOn | Last modified timestamp. |
info.metadata | Metadata associated with the directory encoded as a base64 string. |
files | List of metadata related to the files in the directory. |
subDirectories | List of metadata related to the subdirectories. |
Examples
var request = require('request');
var endPoint = 'http://localhost:8100/nfs/directory/app/';
var onResponse = function(err, response, body) {
if (err) {
return console.error(err.message);
}
if (response.statusCode === 200) {
return console.log(body);
}
console.error('Failed', body);
};
request.get(endPoint, {
auth: {
bearer: constants.token
}
}, onResponse);