$token =
$this->downloadService->
regenerateToken($context,
$fileId);
return new JsonResponse(['accessToken' =>
$token]);
} #[Route(path: '/api/_action/import-export/file/download', name: 'api.action.import_export.file.download', defaults: ['auth_required' => false], methods: ['GET'])]
public function download(Request
$request, Context
$context): Response
{ /** @var array<string> $params */
$params =
$request->query->
all();
$definition =
new DataValidationDefinition();
$definition->
add('fileId',
new NotBlank(),
new Type('string'
));
$definition->
add('accessToken',
new NotBlank(),
new Type('string'
));
$this->dataValidator->
validate($params,
$definition);
return $this->downloadService->
createFileResponse($context,
$params['fileId'
],
$params['accessToken'
]);
} #[Route(path: '/api/_action/import-export/cancel', name: 'api.action.import_export.cancel', methods: ['POST'])]
public function cancel(Request
$request, Context
$context): Response
{ $logId =
$request->request->
get('logId'
);