Page 1 of 3

Correct syntax for database request

Posted: Sat Feb 14, 2015 1:58 pm
by Joe Bohen

I am making a request to the database using the distinct operator and am getting a bad request returned when I post the request directly into a browser I get:
'The request sent by the client was syntactically incorrect ().' The request looks like:

https://api.appery.io/rest/1/db/colle...

If I remove the 'where' section from the request I still get the error so the problem what is the correct syntax for this type of request.


Correct syntax for database request

Posted: Sun Feb 15, 2015 1:41 am
by Illya Stepanov

Hi Joe -

Have you tried this query in your database “Query” section? Is it works?
:: http://devcenter.appery.io/documentat...


Correct syntax for database request

Posted: Wed Feb 18, 2015 12:16 pm
by Joe Bohen

Hi Illya,

Sorry it has taken me some time to get back to you, I have attempted to repeat the query from a test app and I still get the same error.

{
"status":400,
"uri":"https://api.appery.io/rest/1/db/colle...",
"response":{
"code":"BCXX002",
"description":"Cannot consume content type"
}
}


Correct syntax for database request

Posted: Wed Feb 18, 2015 10:11 pm
by Ihor Didevych

Hi Joe,

Is your collection secure or not? Please check at Security and permission tab of collection. And could you share print screen with your query from test app please?


Correct syntax for database request

Posted: Thu Feb 19, 2015 9:07 am
by Joe Bohen

Hi
The collection is not set to secure! below is an image of the test tab on the service.

Image


Correct syntax for database request

Posted: Thu Feb 19, 2015 6:00 pm
by Illya Stepanov

Hi Joe -

Please share your app and tell us its name and describe steps how to reach your service in it.


Correct syntax for database request

Posted: Sat Feb 21, 2015 10:04 am
by Joe Bohen

The app is shared and is named popuptest. There is only one service in the app.


Correct syntax for database request

Posted: Sun Feb 22, 2015 2:29 pm
by Illya Stepanov

Joe - please enter your session token in Headers parameters of your list service:
Image


Correct syntax for database request

Posted: Sun Feb 22, 2015 9:21 pm
by Joe Bohen

Hi I have included the session token, in the mapping (I have logged on with another application which includes login page and provides a valid token.) I get exactly the same response!


Correct syntax for database request

Posted: Mon Feb 23, 2015 8:57 am
by Joe Bohen

Hi, I have added a button to the form which will log the user in to a test account!