I am trying to make a POST request to an API of mine. As I can see in the API's logs, the requests are received and return a 202 status. However, the Typescript in the Office Scripts show a failure which is not really helpful.
Has somebody experienced the same and has solved it?
async function main(workbook: ExcelScript.Workbook): Promise <void> {
console.log(new Date().toLocaleString())
const url: string = 'https://<MYLOGICAPP>.azurewebsites.net:443/api/<WORKFLOWNAME>/triggers/manual/invoke?api-version=2022-05-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=<SIG>'
let res: object
try{
const param = {
method: "POST",
body: JSON.stringify({ id: 1, success: true })
};
console.log(1)
res = await fetch(url, param);
console.log(2)
}
catch(e){
console.log(3)
console.log(res)
console.log(e)
}
console.log(4)
}
As you can see the fetch immediately fails. Here's the output, Guids redacted.