CORS issues on developer portal
You get following errors in the browser console:
Access to fetch at 'https://<Your Gateway URL>/<Your API>/' from origin 'https://<Your Dashboard URL>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
POST https://<Your Gateway URL>/<Your API>/ net::ERR_FAILED
The CORS middleware in the Gateway is blocking this request. This can happen when the CORS settings of the API are not enabled or misconfigured for the developer portal.
Make sure that your CORS in the
Advanced Options of the API is enabled and the settings are correct. This means:
Allowed Originsshould allow the developer portal domain
Allowed Methodsshould allow all methods needed for API documentation (at least
Allowed Headersshould allow at least
Content-Typeand for authenticated requests the authorization header (e.g.
Note: When creating a new API with Dashboard v3.1 and higher the CORS settings will be prefilled with some default values (but disabled by default).
You can learn more about CORS on this pages: