Skip to content

Function: deleteFileEval()

ts
function deleteFileEval(
   ctx: Context, 
   token: string, 
   options: {
  driveId: string;
  fileId: string;
}): Promise<boolean>;

Defined in: src/ms-graph/sharepointGraphEval.ts:766

Delete a file from a SharePoint drive via the Graph API (browser eval variant).

Parameters

ParameterTypeDescription
ctxContextThe SDK context.
tokenstringAccess token from getSharePointTokenUserAuth.
options{ driveId: string; fileId: string; }The drive and file identifiers.
options.driveIdstringThe drive ID.
options.fileIdstringThe file ID.

Returns

Promise<boolean>

True if the file was deleted.

Example

ts
const token = await getSharePointTokenUserAuth(ctx, authProps);
const deleted = await deleteFileEval(ctx, token, {
  driveId: 'drive-abc123',
  fileId: 'outdated-file-id',
});
console.log('Deleted:', deleted);

Matterway Assistant SDK Documentation