I'm using the @azure/communication-common and @azure/communication-calling libraries in my JavaScript application to create a call between two users. I've made use of the following API: "POST {endpoint}/calling/serverCalls/{serverCallId}/recordings?api-version=2021-08-30-preview," as detailed in the Azure Communication Services API documentation here.
To authenticate my requests, I'm utilizing a User Access Token generated from my Azure Communication Service resource, which is passed as a Bearer Token in the "Authorization" header of my fetch request. However, I'm encountering a CORS (Cross-Origin Resource Sharing) error when I don't specify a mode for my request. When I do specify the mode as "no-cors," I receive a 401 (Unauthorized) error.
I have explored various solutions mentioned in the Azure Documentation, but the issue persists. Could someone please assist me in resolving this?
I have provided the token as a Bearer token as described in here, but still get 401.