I'm trying to create an OTRS ticket.
Web service type HTTP:REST
.
var data = {
Ticket: {
Title: "123123",
TypeID: "2",
QueueID: "1",
State: "open",
PriorityID: "2",
ServiceID: "1"
},
Article: {
Subject: "123123",
Body: "Trololo",
ContentType: "text/plain; charset=utf8"
},
SessionID: 123
};
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: JSON.stringify(data),
success: function(res) {
...
},
error: function(res) {
...
}
});
And after submitting I got an error: Could not read input data
.
If I try change method to GET and change the data type to JS obj I've got another
error:
ErrorCode:"TicketCreate.MissingParameter"
ErrorMessage:"TicketCreate: Ticket parameter is missing in or not valid!"
What am I doing wrong?