4. File Storage

File API

Upload a File

Parameters

Type

metadata

FileMetadataReq

file

ArrayBuffer | Buffer

fileType

string

Response:

  • FileMetadataRes: The File metadata.

FileMetadataReq type:

interface FileMetadataReq {
  name: string;
  source: string;
  tags?: string[];
  title?: string;
  description?: string;
  dateCreated?: number;
  lastUpdated?: number;
}

Response type:

Example:

Example response:

Mark a file as public

Parameters

Type

fileId

string

Response:

  • FileMetadataRes: The File metadata.

Example:

Mark a file as private

Parameters

Type

fileId

string

Response:

  • FileMetadataRes: The File metadata.

Example:

Update File metadata

Parameters

Type

fileId

string

Response:

  • FileMetadataRes: The File metadata.

Example:

Search Files

Parameters

Type

metadata

FileMetadataReq

Response:

  • Array: An array of File metadata.

Example:

Delete File

Parameters

Type

fileId

string

Response:

  • FileMetadataRes: The File metadata.

Example:

Generate File content URL

Parameters

Type

fileId

string

Response:

  • string: The URL to the content.

Example:

Last updated

Was this helpful?