Skip to main content

EstuaryClient.CollectionsApi

All URIs are relative to https://api.estuary.tech

MethodHTTP requestDescription
collectionsColuuidCommitPostPOST /collections/{coluuid}/commitProduce a CID of the collection contents
collectionsColuuidContentsDeleteDELETE /collections/{coluuid}/contentsDeletes a content from a collection
collectionsColuuidDeleteDELETE /collections/{coluuid}Deletes a collection
collectionsColuuidGetGET /collections/{coluuid}Get contents in a collection
collectionsColuuidPostPOST /collections/{coluuid}Add contents to a collection
collectionsFsAddPostPOST /collections/fs/addAdd a file to a collection
collectionsGetGET /collections/List all collections
collectionsPostPOST /collections/Create a new collection
# **collectionsColuuidCommitPost** > 'String' collectionsColuuidCommitPost(coluuid)

Produce a CID of the collection contents

This endpoint is used to save the contents in a collection, producing a top-level CID that references all the current CIDs in the collection.

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var coluuid = "coluuid_example"; // String | coluuid


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

Parameters

NameTypeDescriptionNotes
coluuidStringcoluuid

Return type

'String'

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
# **collectionsColuuidContentsDelete** > 'String' collectionsColuuidContentsDelete(coluuid, contentid, body)

Deletes a content from a collection

This endpoint is used to delete an existing content from an existing collection. If two or more files with the same contentid exist in the collection, delete the one in the specified path

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var coluuid = "coluuid_example"; // String | Collection ID

var contentid = "contentid_example"; // String | Content ID

var body = new EstuaryClient.MainDeleteContentFromCollectionBody(); // MainDeleteContentFromCollectionBody | Variable to use when filtering for files (must be either 'path' or 'content_id')


var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.collectionsColuuidContentsDelete(coluuid, contentid, body, callback);

Parameters

NameTypeDescriptionNotes
coluuidStringCollection ID
contentidStringContent ID
bodyMainDeleteContentFromCollectionBodyVariable to use when filtering for files (must be either 'path' or 'content_id')

Return type

'String'

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
# **collectionsColuuidDelete** > collectionsColuuidDelete(coluuid)

Deletes a collection

This endpoint is used to delete an existing collection.

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var coluuid = "coluuid_example"; // String | Collection ID


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

Parameters

NameTypeDescriptionNotes
coluuidStringCollection ID

Return type

null (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined
# **collectionsColuuidGet** > 'String' collectionsColuuidGet(coluuid, opts)

Get contents in a collection

This endpoint is used to get contents in a collection. If no colpath query param is passed

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var coluuid = "coluuid_example"; // String | coluuid

var opts = {
'dir': "dir_example" // String | Directory
};

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

Parameters

NameTypeDescriptionNotes
coluuidStringcoluuid
dirStringDirectory[optional]

Return type

'String'

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
<a name="collectionsColuuidPost"></a>
# **collectionsColuuidPost**
> {'String': 'String'} collectionsColuuidPost(coluuid, contentIDs)

Add contents to a collection

This endpoint adds already-pinned contents (that have ContentIDs) to a collection.

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var coluuid = "coluuid_example"; // String | coluuid

var contentIDs = [new EstuaryClient.[Number]()]; // [Number] | Content IDs to add to collection


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

Parameters

NameTypeDescriptionNotes
coluuidStringcoluuid
contentIDs[Number]Content IDs to add to collection

Return type

{'String': 'String'}

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json
# **collectionsFsAddPost** > collectionsFsAddPost(coluuid, content, path)

Add a file to a collection

This endpoint adds a file to a collection

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var coluuid = "coluuid_example"; // String | Collection ID

var content = "content_example"; // String | Content

var path = "path_example"; // String | Path to file


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

Parameters

NameTypeDescriptionNotes
coluuidStringCollection ID
contentStringContent
pathStringPath to file

Return type

null (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
# **collectionsGet** > [CollectionsCollection] collectionsGet()

List all collections

This endpoint is used to list all collections. Whenever a user logs on estuary, it will list all collections that the user has access to. This endpoint provides a way to list all collections to the user.

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

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

Parameters

This endpoint does not need any parameter.

Return type

[CollectionsCollection]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json
# **collectionsPost** > CollectionsCollection collectionsPost(body)

Create a new collection

This endpoint is used to create a new collection. A collection is a representaion of a group of objects added on the estuary. This endpoint can be used to create a new collection.

Example

var EstuaryClient = require('estuary-client');
var defaultClient = EstuaryClient.ApiClient.instance;

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

var apiInstance = new EstuaryClient.CollectionsApi();

var body = new EstuaryClient.MainCreateCollectionBody(); // MainCreateCollectionBody | Collection name and description


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

Parameters

NameTypeDescriptionNotes
bodyMainCreateCollectionBodyCollection name and description

Return type

CollectionsCollection

Authorization

bearerAuth

HTTP request headers

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