通过此代码请帮助如何创建 ZENDESK 票
<script type = "text/javascript" >
$(function() {
$("#btnGet").click(function() {
$.ajax({
url: 'https://xxxx.zendesk.com/api/v2/tickets/1.json',
contentType: 'application/json',
type: 'POST',
data: JSON.stringify({
"ticket": {
"subject": "Tst SUB",
"comment": {
"body": "Test BODY"
}
}
}),
success: function(response) {
alert("Hello: Success");
},
failure: function(response) {
alert("Fail");
},
error: function(response) {
alert("Error");
}
});
});
});
</script>