REST API: Creating objects - error handling

Hello!

Trying to create my first object using REST API, I get this error:

event = (table) {
“bytesEstimated”:66,
“bytesTransferred”:66,
“name”:“networkRequest”,
“phase”:“ended”,
“requestId”:"<userdata>",
“response”:“Internal server error with id D7FC6735-6585-DFDB-FF88-1A3CF26DE800”,
“responseHeaders”:{
“Access-Control-Allow-Origin”:"*",
“Content-Length”:“66”,
“Access-Control-Allow-Methods”:“POST, GET, OPTIONS, PUT, DELETE, PATCH”,
“Content-Type”:“application/json”,
“Date”:“Tue, 23 Feb 2016 16:49:54 GMT”,
“Access-Control-Allow-Headers”:“origin, application-id, application-type, content-type, secret-key, request, user-token”,
“Connection”:“keep-alive”,
“Server”:“nginx/1.4.2”
},
“responseType”:“text”,
“status”:500,
“url”:“https://api.backendless.com/v1/data/Config”,
“isError”:false
}

I have two questions here:

  1. What is happening?
  2. Why “isError” is false, and how can I know programmatically when I have an error or when all works fine?

I’m calling uri https://api.backendless.com/v1/data/Config with POST method with data: {“clave”:“TEST 1456246714”,“valor”:“valor 1456246714”,“descripcion”:“Testeando create object en backendless”}

My app-id is 6D0A276D-A01B-E2AF-FF2B-3E2D5F842A00.

Thank you once more!

Hello!

I’ve opened an internal task for your issue and we are working on it. We shall investigate this problem.
Can you please tell us which way do you execute the request? Do you have this problem when invoking it using “curl” utility as described in docs?
best regards,
Alex

I’m using LUA. I have no problems creating users, login, logout, … or getting objects.

I call network.request with
uri: https://api.backendless.com/v1/data/Config
action: POST

requestParams = (table) {
“body”:"{“clave”:“TEST 1456333481”,“valor”:“valor 1456333481”,“descripcion”:“Testeando create object en backendless”}",
“headers”:{
“Content-Type”:“application/json”,
“user-token”:“8F6F32EE-5C6B-9895-FFC0-CC35573E4300”,
“application-id”:“6D0A276D-A01B-E2AF-FF2B-3E2D5F842A00”,
“secret-key”:"<my rest secret key>",
“application-type”:“REST”
}
}

I may send you the code by email if necessary.

Thanks

I’ve just tried with an other table and it worked fine, so I imagine the problem may be in something on the table structure or the data I try to create, not in the way I did the call.

Hi!
Maybe your Config table was created in some special way (maybe using import tool)?

Hi,

Your problem is fixed in Config table. Please try to save something again and confirm.

I was just trying to try, … but now I get timeouts, on this or on other tables/apps.

I’ll try later. Thanks!!

Ok, now it seems to work fine. Thank you.

Which was the problem?