Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Not able to call a database rest service with get operation from server code

Hi
I am calling a database service from the server code with GET operation
but i m getting following error :

{ status: 400, headers: { Server: 'nginx', Date: 'Mon, 10 Feb 2014 20:41:08 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', Connection: 'keep-alive' }, body: { code: 'DBSQ219', description: 'Incorrect query' } }

Given below is my server script snippet :

// Get the response with a given username from the database
var XHRResponse = XHR.send("GET", "https://api.appery.io/rest/1/db/colle...", {
"headers": {
"X-Appery-Database-Id": dbId,
"X-Appery-Master-Key": masterKey
},
"parameters": {
"where": '{"userName": "' + userName + '"}'

Code: Select all

 } 

});

Please let me know if i m using correct syntax or not

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Not able to call a database rest service with get operation from server code

Hello! Please remove space between semicolon and quotes in the following line pre"where": '{"userName": "' + userName + '"}'/preIt should become pre"where": '{"userName":"' + userName + '"}'/pre

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

Not able to call a database rest service with get operation from server code

Hi Maryna,
Its working now, thanks a lot!!

Return to “Issues”