Page 1 of 1

REST API (add action) (v2022)

Posted: Mon Feb 06, 2023 4:59 pm
by emlim896

Hello,

Try using REST API (add action) in ASP.NET Maker 2022. Always getting failed result with,

{
"success": false,
"error": "Failed to create instance",
"version": "19.8.0"
}

my code,

$.ajax({
url: "api/add/Orders",
method: "post",
data: "OrderID=12345",
async: false,
cache: false,
beforeSend: function(request) {
request.setRequestHeader("Authorization", "Bearer "+store.JWT);
},
success: function(result, status, xhr) {
console.log( result );
},
complete: function(xhr, status) {
console.log( status );
}
});


Any help would be appreciated.

Thanks.


Re: REST API (add action) (v2022)

Posted: Tue Feb 07, 2023 7:37 am
by MichaelG

Make sure that the table "Orders" exists. Then enable debug mode (Tools -> Advanced Settings -> Debug) and press F12 -> Network to check the server response.


Re: REST API (add action) (v2022)

Posted: Tue Feb 07, 2023 12:53 pm
by emlim896

nothing suspicious from server request/response.

I got http reply status 200 OK. if i put wrong table name i got 500 internal server error.