Outlook Add-in: Handling Error Responses from API Call

Sander 0 Reputation points
2025-01-07T10:14:58.5+00:00

Hi,

My Outlook Add-in has a button and when I click the button it invokes my JS function perfectly.

I then added a fetch request to my local API and that worked as well.

The issue is, that response always receives an error even though it hits the endpoint successfully which returns a 200?

I've tried to use XMLHttpRequest as an alternative method but get the same result.

I send a POST request with FormData to my HTTPS .NET API.

Wrapping it in a try/catch works fine but i'm not able to act on the response if something goes wrong.

Has anyone had this issue before or know a solution to this?

Microsoft 365 and Office Development Other
Outlook Windows Classic Outlook for Windows For business
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.