I am having trouble with making a JSON Post request to the Simpleconsign API, as I keep getting a 0 error from the browser. Below is my code snippet:
<script type="text/javascript">
JSONTest = function() {
var resultDiv = $("#resultDivContainer");
$.ajax({
type: 'POST',
key: "apikey",
url: 'https://user.traxia.com/app/api/inventory',
contentType: "application/json",
success: function(result){
switch (result) {
case true:
processResponse(result);
break;
default:
resultDiv.html(result);
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
};
</script>
As a novice in working with REST APIs, any guidance on how to resolve this issue would be highly valued. Thanks in advance for your assistance!