Skip to content

Function: moveFileEval()

ts
function moveFileEval(
   ctx: Context, 
   token: string, 
   options: {
  driveId: string;
  parentId: string;
  fileId: string;
  destinationPath: string;
}): Promise<any>;

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

Move a file in a SharePoint drive via the Graph API (browser eval variant).

Parameters

ParameterTypeDescription
ctxContextThe SDK context.
tokenstringAccess token from getSharePointTokenUserAuth.
options{ driveId: string; parentId: string; fileId: string; destinationPath: string; }The move options.
options.driveIdstringThe drive ID containing the file.
options.parentIdstringThe destination parent folder ID.
options.fileIdstringThe file ID to move.
options.destinationPathstringThe new name or path for the file.

Returns

Promise<any>

The move response object from the Graph API.

Example

ts
const token = await getSharePointTokenUserAuth(ctx, authProps);
const result = await moveFileEval(ctx, token, {
  driveId: 'drive-abc123',
  parentId: 'completed-folder-id',
  fileId: 'in-progress-file-id',
  destinationPath: 'proposal-final.docx',
});
console.log('Moved to:', result.name);

Matterway Assistant SDK Documentation