API Update Ticket CORS error
I'm trying to update a ticket from an MVC C# application using ajax, but i'm getting a CORS error, tried a lot of different ajax configurations but still get the error
Any help is appreciated.
Code:
var data = JSON.stringify({ "NewStatusID": "2", "Comments": "TEST", "Notify": "xxxxx@ttuhsc.edu", "IsPrivate": "0" });
$.ajax({
url: 'https://XXX.teamdynamix.com/TDWebApi/api/XXXX/tickets/XXXX/feed',
type: 'POST',
headers: {
'Authorization': 'Bearer ' + $("#AuthorizationToken").val(),
'Content-Type': 'text/json'
},
data: data,
processData: false,
contentType: false,
success: function (data) {
alert(data);
console.log(data);
},
error: function (xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(err);
}
});
Access to XMLHttpRequest at 'http://XXXX.teamdynamix.com/TDWebApi/api/XXX/tickets/9910287/feed' from origin 'http://localhost:61739' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
Answer (1)
Hello Jose,
Since you have submitted this as a ticket you can refer to the ticket for correspondence on this question. Feel free to post the solution that is provided from the ticket into this forum so it may benefit other clients though!
Sincerely,
Mark Sayers
TD Support