Page 1 of 1

(400) Bad Request

Posted: Fri Jun 19, 2015 2:42 pm
by Marc Hitchcock

I am attempting to incorporate the login/signup example for Bootstrap/AngularJS into my app, when I test the database service it works fine yet when I copy over the code from the example to my app and change the service referenced to my service it results in a (400) bad request for both login and sign up.

I have copied everything over from the example exactly as it was shown, so the required variables, the inputs, buttons and the code for both login() and register()

I have been tearing my hair out over this one for the last few hours and I cannot seem to find out what the issue is.

Login code
//Login();
var requestData = {};
requestData.params = Apperyio.EntityAPI('data_login_service.request.query', undefined, true);

var username_scope = $scope["username"];
var password_scope = $scope["password"];
requestData.params["username"] = username_scope;
requestData.params["password"] = password_scope;

Apperyio.get("data_login_service")(requestData).then(

Code: Select all

 function(success){ 

//Store sessionToken to Settings
Apperyio.configAdd('Settings.sessionToken', success.data.sessionToken);

Code: Select all

     Apperyio.navigateTo('Featured'); 

 }, 

function(error){
alert('Error when signing in');

Code: Select all

 }); 

Register code
//register();
var requestData = {};
requestData.data = Apperyio.EntityAPI('data_signup_service.request.body', undefined, true);

var username_scope = $scope["register_username"];
var password_scope = $scope["register_password"];
requestData.data.username = username_scope;
requestData.data.password = password_scope;

Apperyio.get("data_signup_service")(requestData).then(

Code: Select all

 function(success){ 
     //Store sessionToken to Settings 
    Apperyio.configAdd('Settings.sessionToken', success.data.sessionToken); 

     Apperyio.navigateTo('Featured'); 

 }, 
 function(error){ 
     alert('Error when registering'); 

 }); 

My app is shared with support, it is called WeLove Kent


(400) Bad Request

Posted: Sat Jun 20, 2015 6:52 am
by Evgene Karachevtsev

Hello Marc,

Could you please clarify do you have any errors in a browser console?


(400) Bad Request

Posted: Sat Jun 20, 2015 1:02 pm
by Marc Hitchcock

The 400 bad request error is from the console, the code just fires the function(error) event.
I have tried pretty much everything I can think of. Removing the DB and starting again, removing the code and starting again etc etc. Every time I end up with the same result, Error when registering alert and a 400 (Bad Request) in the console.


(400) Bad Request

Posted: Thu Jul 02, 2015 12:39 pm
by Alena Prykhodko

Hello Marc,

I do not see app WeLove Kent shared.
Please share (http://devcenter.appery.io/documentat...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and tell us Service name.


(400) Bad Request

Posted: Thu Jul 02, 2015 12:56 pm
by Marc Hitchcock

I was able to solve this in the end, I switched to an external database using API Express and rebuilt my code using that which worked.