Skip to content

Latest commit

 

History

History
788 lines (551 loc) · 22.4 KB

File metadata and controls

788 lines (551 loc) · 22.4 KB

Id4iApi.StorageApi

All URIs are relative to https://backend.id4i.de

Method HTTP request Description
createDocument POST /api/v1/documents/{id4n}/{organizationId} Create an document for an id4n
deleteDocument DELETE /api/v1/documents/{id4n}/{organizationId}/{fileName} Delete a document
getDocument GET /api/v1/documents/{id4n}/{organizationId}/{fileName}/metadata Retrieve a document (meta-data only, no content)
getPublicDocument GET /api/v1/public/documents/{id4n}/{organizationId}/{fileName}/metadata Retrieve a public document (meta-data only, no content)
listAllDocuments GET /api/v1/documents/{id4n} List documents
listAllPublicDocuments GET /api/v1/public/documents/{id4n} List public documents
listDocuments GET /api/v1/documents/{id4n}/{organizationId} List organization specific documents
putDocument PUT /api/v1/documents/{id4n}/{organizationId} Put an document for an id4n
readDocument GET /api/v1/documents/{id4n}/{organizationId}/{fileName} Read document contents
readFromMicrostorage GET /api/v1/microstorage/{id4n}/{organization} Read data from microstorage
readPublicDocument GET /api/v1/public/documents/{id4n}/{organizationId}/{fileName} Read public document contents
updateDocumentMetadata PATCH /api/v1/documents/{id4n}/{organizationId}/{fileName}/metadata Update a document
writeToMicrostorage PUT /api/v1/microstorage/{id4n}/{organization} Write data to microstorage

createDocument

Document createDocument(organizationId, id4n, content)

Create an document for an id4n

The documents' mime type is suggested on octet-stream data. Otherwise the specified content mime type is used.

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

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


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createDocument(organizationId, id4n, content, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
content File content

Return type

Document

Authorization

Authorization

HTTP request headers

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

deleteDocument

deleteDocument(organizationId, id4n, fileName)

Delete a document

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var fileName = "fileName_example"; // String | fileName


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

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
fileName String fileName

Return type

null (empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

getDocument

Document getDocument(organizationId, id4n, fileName)

Retrieve a document (meta-data only, no content)

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var fileName = "fileName_example"; // String | fileName


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getDocument(organizationId, id4n, fileName, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
fileName String fileName

Return type

Document

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

getPublicDocument

Document getPublicDocument(organizationId, id4n, fileName)

Retrieve a public document (meta-data only, no content)

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var fileName = "fileName_example"; // String | fileName


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getPublicDocument(organizationId, id4n, fileName, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
fileName String fileName

Return type

Document

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

listAllDocuments

PaginatedResponseOfDocument listAllDocuments(id4n, opts)

List documents

Listing all documents of an id4n

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var id4n = "id4n_example"; // String | id4n

var opts = { 
  'owner': "owner_example", // String | Filter by owner organization
  'offset': 56, // Number | Start with the n-th element
  'limit': 56 // Number | The maximum count of returned elements
};

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

Parameters

Name Type Description Notes
id4n String id4n
owner String Filter by owner organization [optional]
offset Number Start with the n-th element [optional]
limit Number The maximum count of returned elements [optional]

Return type

PaginatedResponseOfDocument

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

listAllPublicDocuments

PaginatedResponseOfDocument listAllPublicDocuments(id4n, opts)

List public documents

Listing all public documents of an id4n

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var id4n = "id4n_example"; // String | id4n

var opts = { 
  'organizationId': "organizationId_example", // String | organizationId
  'owner': "owner_example", // String | Filter by owner organization
  'offset': 56, // Number | Start with the n-th element
  'limit': 56 // Number | The maximum count of returned elements
};

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

Parameters

Name Type Description Notes
id4n String id4n
organizationId String organizationId [optional]
owner String Filter by owner organization [optional]
offset Number Start with the n-th element [optional]
limit Number The maximum count of returned elements [optional]

Return type

PaginatedResponseOfDocument

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

listDocuments

PaginatedResponseOfDocument listDocuments(organizationId, id4n, opts)

List organization specific documents

Listing documents of an id4n seen by a specified organization

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var opts = { 
  'owner': "owner_example", // String | Filter by owner organization
  'offset': 56, // Number | Start with the n-th element
  'limit': 56 // Number | The maximum count of returned elements
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listDocuments(organizationId, id4n, opts, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
owner String Filter by owner organization [optional]
offset Number Start with the n-th element [optional]
limit Number The maximum count of returned elements [optional]

Return type

PaginatedResponseOfDocument

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

putDocument

Document putDocument(organizationId, id4n, content)

Put an document for an id4n

Creating or overwriting an existing document

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

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


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.putDocument(organizationId, id4n, content, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
content File content

Return type

Document

Authorization

Authorization

HTTP request headers

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

readDocument

'Blob' readDocument(organizationId, id4n, fileName)

Read document contents

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var fileName = "fileName_example"; // String | fileName


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.readDocument(organizationId, id4n, fileName, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
fileName String fileName

Return type

'Blob'

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

readFromMicrostorage

'Blob' readFromMicrostorage(organization, id4n)

Read data from microstorage

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organization = "organization_example"; // String | organization

var id4n = "id4n_example"; // String | id4n


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

Parameters

Name Type Description Notes
organization String organization
id4n String id4n

Return type

'Blob'

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

readPublicDocument

'Blob' readPublicDocument(organizationId, id4n, fileName)

Read public document contents

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var fileName = "fileName_example"; // String | fileName


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.readPublicDocument(organizationId, id4n, fileName, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
fileName String fileName

Return type

'Blob'

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

updateDocumentMetadata

Document updateDocumentMetadata(organizationId, id4n, fileName, document)

Update a document

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organizationId = "organizationId_example"; // String | organizationId

var id4n = "id4n_example"; // String | id4n

var fileName = "fileName_example"; // String | fileName

var document = new Id4iApi.DocumentUpdate(); // DocumentUpdate | document


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateDocumentMetadata(organizationId, id4n, fileName, document, callback);

Parameters

Name Type Description Notes
organizationId String organizationId
id4n String id4n
fileName String fileName
document DocumentUpdate document

Return type

Document

Authorization

Authorization

HTTP request headers

  • Content-Type: application/xml, application/json
  • Accept: application/xml, application/json

writeToMicrostorage

Object writeToMicrostorage(organization, id4n, opts)

Write data to microstorage

Example

var Id4iApi = require('id4i_api');
var defaultClient = Id4iApi.ApiClient.instance;

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

var apiInstance = new Id4iApi.StorageApi();

var organization = "organization_example"; // String | organization

var id4n = "id4n_example"; // String | id4n

var opts = { 
  'contentType': "contentType_example", // String | Content-Type
  'contentLength': 789, // Number | Content-Length
  'body': B // Blob | body
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.writeToMicrostorage(organization, id4n, opts, callback);

Parameters

Name Type Description Notes
organization String organization
id4n String id4n
contentType String Content-Type [optional]
contentLength Number Content-Length [optional]
body Blob body [optional]

Return type

Object

Authorization

Authorization

HTTP request headers

  • Content-Type: /
  • Accept: application/xml, application/json