oAuth is not returning any response when using Excel Online Script

oAuth is not returning any response when using Excel Online Script

I am trying to transfer the macro VBA codes in generating authentication tokens to online excel 365 script to pull data from Zoho API but I am not getting any response. This is my function for calling the oAuth:

async function webRequest(client_id: string | number | boolean, client_secret: string | number | boolean, code: string | number | boolean) {
  let url = "https://accounts.zoho.com/oauth/v2/token?code=" + code + "&client_id=" + client_id + "&client_secret=" + client_secret + "&redirect_uri=http://www.zoho.com/inventory&grant_type=authorization_code&scope=ZohoInventory.FullAccess.all";
  
  const result = await fetch(url);
  const json: undefined = await result.json();
  console.log("okk");
  console.log(json);
}

Am I doing something wrong? Is excel scripting out of the scope of Zoho APIs? Do you have any suggestions?