Skip to content

Function: getDataStoreFile()

ts
function getDataStoreFile(ctx: Context, params: {
  dataStoreFileId: string;
  version?: number;
  sessionTokens?: string[];
}): Promise<DataStoreFileDownload>;

Defined in: src/data-store/index.ts:202

Get a specific file from a data store.

Parameters

ParameterTypeDescription
ctxContextCurrent execution context.
params{ dataStoreFileId: string; version?: number; sessionTokens?: string[]; }Query parameters.
params.dataStoreFileIdstringThe ID of the data store file.
params.version?numberOptional version number. If omitted, fetches the latest version.
params.sessionTokens?string[]Optional session tokens.

Returns

Promise<DataStoreFileDownload>

The file download info.

Example

ts
const file = await getDataStoreFile(ctx, { dataStoreFileId: 'file-456' });
console.log(file.name, file.url);

// Fetch a specific version
const v2 = await getDataStoreFile(ctx, { dataStoreFileId: 'file-456', version: 2 });

Matterway Assistant SDK Documentation