Page 1 of 1

200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 4:53 am
by Collin Mann

My custom server script is working fine when I test it on the test tab on the server. It returns exactly what I expected and wanted, but when I try and test the same service with exact same parameters and exact same values for those parameters, this error is thrown by my custom server script, "message: Database name must be defined.ncode: DBSQ10."

When I searched for that code, there was absolutely no information on google or on this forum. It's pretty obvious that it is saying my database name is not defined, which would mean that the parameter name that I was sending as a request did not match the parameter name that I was request.get() "ing" in my custom server script, but they do. And I've spent hours on this trying to alter different things to make it work. When I type in the wrong parameter purposefully on the server test tab, I ALSO get the same error, but the parameters are not incorrect, so it's not making much sense. I also changed the database name of the parameter multiple times to make sure that they were matching, but to no avail. Is there something I'm missing here?

I added pictures of both test pages as well as the code of my custom server script. Image Image Image Image


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 8:15 am
by Kateryna Grynko

Hi Collin,

Do you pass X-Appery-Database-Id and X-Appery-Session-Token as header parameters?


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 8:21 pm
by Collin Mann

Yes


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 8:23 pm
by Collin Mann

You can skip all of the beginner questions.


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 8:46 pm
by Maryna Brodina

Hello! Please post screenshots from service settings and request parameters tab.


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 9:00 pm
by Collin Mann

Basically, regardless of what I type in the parameters (even if I pass the script nothing or everything) I get the same error 200 code message. It's got to be something wrong with my script I assume. I've tried the settings on both none and with GreekbaseDB, but I assume the settings really don't matter unless you're trying to pass a parameter from them, such as the DB ID, but even when I tried it with the {database_id} param from the GreekbaseDB settings, with the GreekbaseDB settings enabled, I got the same message.
Image Image Image Image


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 10:48 pm
by Alena Prykhodko

Please uncheck Header in Service settings for parameters X-Appery-Database-Id and X-Appery-Session-Token


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Thu Jan 09, 2014 11:09 pm
by Collin Mann

You're awesome!! Thank you, that worked. Can you explain to me why I do not use headers for the script? Is it because the script is an intermediary before hitting the database?


200 level successful error saying that my Database Id is incorrect when trying grab the HTML that my custom server scrip

Posted: Fri Jan 10, 2014 9:32 pm
by Maryna Brodina

Hello! In server script you receive DB_id and token through request.get and this function doesn't receive data from headers.