How to download file in Js?

I am making an api call to export excel file and api is returning the response as encrypted string like,

PK-[Content_Types].xmlµSËnÂ0ü•È×*6ôPUCÇ©ô{“Xø%¯¡ð÷]8”R‰
qòcfgfWöd¶q¶ZCB|ÃÆ|Ä*ð*h㻆},^ê{Va–^K<4lÈfÓÉb+ªõØ°>çø ªœD"xBÚœÌtLˆR-eâv4º*ø>×¹h°éä  Z¹²¹zÜÝé†É­Q2S,±öúH´Þòvà`o"ÞUÏRÙµC(2q†Ãqa9SÝ
& ........... goes on .......

So the above response needs to be converted into downloadable excel file.

For which I have used the following code,

const outputFilename = `${Date.now()}.xls`;
const url = URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', outputFilename);
document.body.appendChild(link);
link.click();

It generate an excel file but when I open the file, it says that the file format is unsupported.

Could you please help me with steps to convert the response data into an real downloadable excel file without issues?

I am using reactjs app for the implementation

Thanks in advance.