REST API (add action) (v2022)

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
emlim896
User
Posts: 13

REST API (add action) (v2022)

Post 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.


MichaelG
User
Posts: 1095

Post 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.


emlim896
User
Posts: 13

Post 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.


Post Reply