Skip to content

Latest commit

 

History

History
446 lines (305 loc) · 9.93 KB

File metadata and controls

446 lines (305 loc) · 9.93 KB

Woden.FileSystemApi

All URIs are relative to http://localhost:1823/api/v1

Method HTTP request Description
createFolder POST /folder Create folder
downloadFile GET /file/{hash}/{cid} Download file
getFolder GET /folder/{hash} Get folder
search GET /search/{name} Search
tree GET /tree Get folders tree
updateFile PUT /file Update file
uploadFile POST /file Upload file
versions GET /versions/{hash} Versions of file

createFolder

createFolder(body)

Create folder

Creating folder by user

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var body = new Woden.CreateFolder(); // CreateFolder | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.createFolder(body, callback);

Parameters

Name Type Description Notes
body CreateFolder

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

downloadFile

File downloadFile(hash, cid)

Download file

Downloading file from current folder

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var hash = "hash_example"; // String | The file hash

var cid = "cid_example"; // String | The file version


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.downloadFile(hash, cid, callback);

Parameters

Name Type Description Notes
hash String The file hash
cid String The file version

Return type

File

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, image/png, image/gif, image/jpeg, multipart/form-data, application/pdf

getFolder

getFolder(hash)

Get folder

Getting folder means that user will receive the contents of the folder (files and folders)

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var hash = "hash_example"; // String | The folder hash


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getFolder(hash, callback);

Parameters

Name Type Description Notes
hash String The folder hash

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

search

search(name)

Search

Search folders and files means that user will receive folder or file if exist

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var name = "name_example"; // String | The folder or file name


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.search(name, callback);

Parameters

Name Type Description Notes
name String The folder or file name

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

tree

tree()

Get folders tree

Get tree of folders and shared folders of user

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.tree(callback);

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

updateFile

updateFile(hash, file)

Update file

Update existing file

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var hash = "hash_example"; // String | 

var file = "/path/to/file.txt"; // File | File to upload.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateFile(hash, file, callback);

Parameters

Name Type Description Notes
hash String
file File File to upload.

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

uploadFile

uploadFile(name, parentFolder, file)

Upload file

Uploading file in current folder

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var name = "name_example"; // String | 

var parentFolder = "parentFolder_example"; // String | 

var file = "/path/to/file.txt"; // File | File to upload.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.uploadFile(name, parentFolder, file, callback);

Parameters

Name Type Description Notes
name String
parentFolder String
file File File to upload.

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

versions

versions(hash)

Versions of file

Get all existing versions of file

Example

var Woden = require('woden');
var defaultClient = Woden.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new Woden.FileSystemApi();

var hash = "hash_example"; // String | The folder or file name


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.versions(hash, callback);

Parameters

Name Type Description Notes
hash String The folder or file name

Return type

null (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined