Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Correct syntax for database request

Hi Joe -

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

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

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"
}
}

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Correct syntax for database request

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?

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

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

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Correct syntax for database request

Hi Joe -

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

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Correct syntax for database request

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

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

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!

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

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

Return to “Issues”