Classification File System API (CLFS) (0.0.1)

Download OpenAPI specification:Download

Classification File System API (CLFS)

Flow diagrams explaining registration of the source

CLFS

Source discovery

Get root URLs and support flags. The endpoint that defines support and discovery for other endpoints. Meant to be used periodically for updating what the CLFS implementation supports and allowing gradual updates.

Discovery can return a static response and only use the storageId for URLs if 404 and 503 responses aren't meant to be used for controlling the status of a particular source.

CLFS only needs to implement one: FSURL or DiffURL, depending on technical capabilities and traffic estimates.

path Parameters
storageId
required
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Responses

Response Schema: application/json
Any of
storageId
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

required
object

Declare feature support

version
required
string

version of the CLFS supported

DiffURL
required
string

fully qualified URL to the endpoint returning diffs on storage listing. If provided, will be used instead of FSURL to limit traffic.

ReportURL
required
string

fully qualified URL to the endpoint accepting validation errors

Response samples

Content type
application/json
Example
{
  • "storageId": "string",
  • "support": {
    },
  • "version": "string",
  • "DiffURL": "string",
  • "ReportURL": "string"
}

Clean up after source removed (optional)

This endpoint may be called when the source is removed from Egnyte Protect. Source can use it to clean up access, credentials, cache or any other information no longer necessary.

path Parameters
storageId
required
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Get folder listing

List a folder with separate collections for its direct children - sub-folders and files.

Only one of folder listing and storage diff need to be implemented. If your software can produce diff listing it's the preferable option for performance and efficiency of tracking changes to the storage.

Folders and files lists are one level deep. Egnyte Protect will make requests for all non-empty nested folder listings to discover files there.

Endpoint may optionally support pagination of items in this folder using cursor.

Files can be represented in one of two ways:

  • as a single file without a history, where Egnyte Protect assumes all other versions don't exist anymore,

  • as a file with a complete list of all versions of the file that the system still holds; versions which disappear from the list are also removed in Egnyte Protect classification.

    Expand the 200 Folder listing -> files response to see all details

path Parameters
storageId
required
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

folderId
string

The rest of the URL pointing to a particular filesystem entry

query Parameters
cursor
string

Egnyte Protect will call this endpoint with cursor value from the previous response body to get next chunk of items in this folder.

withPermissions
boolean

Should permissions be returned together with folders and files. By default permissions are not returned.

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Responses

Response Schema: application/json
id
required
string

an id, unique in the entire source

state
string

additional id info that might be required by connector during selected operations

remediationGroup
string

Folder remediation group - if remote source allows only remediation between certain groups of folders, it should be indicated here. Source and target remediation folders must be of the same group. Null if whole source is supported. If folder is not remediatable, value should be NONE

name
required
string
parentId
string

id of the parent folder

path
required
string

path including the item name, starting at the root folder

cursor
string

Cursor allowing to paginate items from this folder. It's a string pointing to the place on the list of items and each request passes the last known cursor value to get items which occurred after that. null means that it's the last chunk. If cursor is not in the response, pagination was not implemented for the source.

viewLink
string

Web Link to view folder in remote source. Optional

Array of objects (FolderStub)
Array of FileInFolderWithoutVersionHistory (object) or FileInFolderWithVersions (object) (FileInFolder)
object (SearchableMetaData)

Searchable meta-data in the form of key-value pairs. The meta-data can be used to provide additional information about the listed item.

Array of any (Permission)
Array of objects (Link)
property name*
any

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "string",
  • "remediationGroup": "string",
  • "name": "string",
  • "parentId": "string",
  • "path": "string",
  • "cursor": "string",
  • "viewLink": "string",
  • "folders": [
    ],
  • "files": [
    ],
  • "searchableMetaData": {
    },
  • "permissions": [
    ],
  • "links": [
    ]
}

Get storage diff listing

Alternative way of presenting storage contents especially useful when the storage structure is large and deeply nested.

Only one of folder listing and storage diff need to be implemented. If your software can produce diff listing it's the preferable option for performance and efficiency of tracking changes to the storage.

Files are represented with a single version id. All version remove actions can be represented as separate entries to maintain consistency in versions between systems.

path Parameters
storageId
required
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

query Parameters
cursor
number
Default: 0

cursor value from the previous response body - for continuity. Each response is returning a cursor - a number in a sequence of changes observed in the storage, and each request passes the last known cursor value to get items which occurred after that.

withPermissions
boolean

Should permissions be returned together with folders and files. By default permissions are not returned.

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Responses

Response Schema: application/json
cursor
number
Array of objects (schemas)
Array of objects (schemas)
Array of objects (FileRemoved)
property name*
any

Response samples

Content type
application/json
{
  • "cursor": 0,
  • "added": [
    ],
  • "changed": [
    ],
  • "removed": [
    ]
}

Get file content

An endpoint to return the file content.

If file content has requiresAuth set, this endpoint is necessary and the content.URL field is pointing to it.
If you can return public links to file content, but the links expire, the best option is to implement this endpoint and make it return a 302 redirecting to the public short-lived URL. That way you don't have to proxy the file content.

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Responses

Response Schema: application/octet-stream
string <binary>

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Reporting

Report an issue with CLFS implementation. The endpoint will be called when errors are found in implementation - output doesn't validate etc.

Not all issues will be reported. An issue with a particular code occurring multiple times may be selectively de-duplicated to avoid flooding the endpoint.

Request Body schema: application/json
code
string

Error code for automated classification / reaction

timestamp
integer

epoch timestamp in miliseconds when the error was noticed

correlationId
string

egnyte-ecosystem-correlation-id header of the problematic request

message
string

A message explaining the issue details

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "timestamp": 0,
  • "correlationId": "string",
  • "message": "string"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Register events webhook

Egnyte Protect will call this endpoint in order to register a webhook for storage events. Connector should register a webhook for a given storageId only once. Next call should override previous registration.

path Parameters
storageId
required
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Request Body schema: application/json
address
required
string

The webhook URL.

secret
required
string

A secret to sign JWT that should be passed in Authorization header for each webhook call.

Responses

Request samples

Content type
application/json
{
  • "address": "string",
  • "secret": "string"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Delete files or move them to another location

Endpoint for batch files remediation (delete or move).

Parameter operation describes if files should be deleted or moved to different location.

Parameter fileIds contains array of file IDs to be remediated.

Parameter sourceFolderId is ID of folder containing files being remediated.

Parameter leaveStubs is by default set to false. When set to true it indicates that for each file being remediated there should be a stub file created with original file name suffixed with .txt and content describing that this file was deleted/moved on specified date.

Parameter targetFolderId has meaning only for move operation. It indicates ID of folder into which files needs to be moved.

Parameter preserveStructure has meaning only for move operation. When set to true it indicates that files after move should have the same relative path to target folder as they had to source folder.

path Parameters
storageId
required
string (StorageId)

The ID identifying the particular customer's data in Host Implementer's storage

header Parameters
egnyte-ecosystem-correlation-id
required
string

Hosts should log this ID for each incoming request; doing so will allow hosts to easily correlate their own logs with issue reports and Egnyte Protect logs

Request Body schema: application/json
operation
required
string (RemediationOperation)
Enum: "delete" "move"
required
Array of objects (IdWithState)
required
object (IdWithState)
leaveStubs
boolean
Default: false
object (IdWithState)
preserveStructure
boolean

It indicates if files after move should have the same relative path to target folder as they had to source folder or if they should be just moved to target folder as flat.

Responses

Request samples

Content type
application/json
{
  • "operation": "delete",
  • "fileIds": [
    ],
  • "sourceFolderId": {
    },
  • "leaveStubs": false,
  • "targetFolderId": {
    },
  • "preserveStructure": true
}

Response samples

Content type
application/json
[
  • {
    }
]