CORS error in Dev Tools

We are getting CORS errors attempting to use the API Explorer in Dev Tools.

0 HTTP request was blocked by CORS. Inspect the browser network tab for more information.

Access to XMLHttpRequest at 'https://api.mypurecloud.com/api/v2/conversations/calls/17cf6634-5ee2-4c4c-80f2-40e76706ce29/timeline' from origin 'https://developer.mypurecloud.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
VM10813:1 GET https://api.mypurecloud.com/api/v2/conversations/calls/17cf6634-5ee2-4c4c-80f2-40e76706ce29/timeline net::ERR_FAILED

CORS errors are caused by making API requests from a domain that's not in your configured redirect URIs for the oauth client (not likely with the dev tools) or the API request is malformed in such a way that it's not hitting the API and therefore won't have CORS headers to the response. Try making the exact same request using the same auth token outside of a browser and see what the response is; only browsers enforce CORS.

Responses blocked by CORS can sometimes have more details on the error if you open the network tab in your brower's developer tools. I've seen before where server side errors from the API will not contain the CORS headers so the browser thinks in was blocked. When a CORS issue comes up, you can't access the response body from JS so the dev tools can't provide any additional info, but looking at the response body in the browser dev tools can get you those additional details

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.