Hi, I'm new using MantisBT.
In my company, we recently adquired the service for support porpouse. I'm trying to make an independent form to submit tickets to the heldesk of the company.
I'm using HTML and JS (for now) to do some tests and see if the Rest Apis are working. Recently I was using one of the endpoints offered by the Mantis Bug Tracker Rest Api Postman collection with JavaScript Fetch.
When I use the "Get an Issue" endpoint, in my form project, the petition is refused by CORS policy: "Access-Control-Allow-Origin". My fetch headers are well build, they have the correct token and the url of the helpdesk with the GET method.
Mantis version : 2.26.2
FETCH RESPONSE:
Access to fetch at 'https://helpdesk.#######/api/rest/issues/0000158' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://#######' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
##### tags are company info.
I am using the same type of fetch that the mantis postman docs offer to use.
Trying to fetch a REST Api Endpoint With JS
Moderators: Developer, Contributor