Start a new topic

Post email in the user creation request


I am trying to create a user from the android application. The only API I can find is

User.createBlocking(username, password);

Because I want to enforce email verification, I need to supply the email in the request. I am doing something like that

Client kinveyClient = new Client.Builder(KINVEY_APP_KEY, KINVEY_APP_SECRET, context).build();

User kinveyUser = kinveyClient.user();

kinveyUser.put("email", "");

kinveyUser.createBlocking(username, password).execute();

But I am receiving an error indicating that no email is supplied. I can't find any other way to insert the email address in the request. Does anyone know how?

Thanks in advance.

So two things:

first, there is also an asynchronous create, which you can use as well. It will take a username, password, and `KinveyUserCallback`. This method will spawn a thread, execute the request, and then call the appropriate methods in that `KinveyUserCallback` object after the request has been completed. To do this, instead of:

User kinveyUser = kinveyClient.user();

you can do:

AsyncUser kinveyUser = kinveyClient.user();

Or, you can just access it directly through:


And finally, what you are doing looks like it should work. Can you open up and double check that the email is not there?

As a quick test I did this, and it works:

AsyncUser myUser = getClient().user();

myUser.put("email", "");

myUser.create("emailtest", "emailtest", new KinveyUserCallback() {


public void onSuccess(User result) {

preload();//To change body of implemented methods use File | Settings | File Templates.



public void onFailure(Throwable error) {

Util.Error(Contentviewr.this, error); //To change body of implemented methods use File | Settings | File Templates.



Hi Edward

It is not working, email address is not sent when creating user.

If "Enforce email verification" is turned on, I get 400 response code Bad Request

{"error":"MissingRequestParameter","description":"A required parameter is missing from the request","debug":"Email Verification is required for this app, but an email address was not provided for this user. Please try again and include an email address in the request."}

This is in response to Edward's answer.

I have tried your method with and without email verification enforcement.

It does not work with email verification enforced. Possibly because of my findings without email verification enforced.

I have also found that the Kinvey Sign Up sample also fails to do this.

I had to create a user and then update the user in the onSuccess method.

public static final String KINVEY_USERNAME = "username";

public static final String KINVEY_USER_EMAIL = "email";

public static final String KINVEY_USER_FIRST_NAME = "first_name";

public static final String KIVEY_USER_LAST_NAME = "last_name";

public void processSignup() {

Toast.makeText(this, "Creating user...", Toast.LENGTH_SHORT).show();








mEditPassword.getText().toString(), new KinveyUserCallback() {

public void onFailure(Throwable t) {

CharSequence text = "Could not sign up -> " + t.getMessage();

Toast.makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show();

Log.e(TAG, "Sign-up error", t);



public void onSuccess(User u) {

mKinveyClient.user().update(new KinveyUserCallback() {


public void onSuccess(User u) {

CharSequence text = "Welcome, "


+ ". Your account has been registered.

Please login to confirm your credentials.";

Log.d(TAG, text.toString());

Toast.makeText(getApplicationContext(), text,


startActivity(new Intent(mContext, LoginActivity.class)






public void onFailure(Throwable t) {

Log.e(TAG, "Failed to update user.");






If I move the code from the onSuccess() of the update callback and move it to the onSuccess() of the create callback, I get null for the user first_name parameter. I had to add the update call in order to get the additional parameters saved to the User class. So I can only get the additional info, including the required email, saved to the user after it is created and then updated.

The problem is that the email is not included in the initial creation request and I get the following error.

08-20 10:10:35.818: E/LoginActivity(11041): Sign-up error

08-20 10:10:35.818: E/LoginActivity(11041): MissingRequestParameter

08-20 10:10:35.818: E/LoginActivity(11041): A required parameter is missing from the request

08-20 10:10:35.818: E/LoginActivity(11041): at

08-20 10:10:35.818: E/LoginActivity(11041): at

08-20 10:10:35.818: E/LoginActivity(11041): at$LoginRequest.execute(

08-20 10:10:35.818: E/LoginActivity(11041): at$Create.executeAsync(

08-20 10:10:35.818: E/LoginActivity(11041): at$Create.executeAsync(

08-20 10:10:35.818: E/LoginActivity(11041): at

08-20 10:10:35.818: E/LoginActivity(11041): at android.os.AsyncTask$

08-20 10:10:35.818: E/LoginActivity(11041): at

08-20 10:10:35.818: E/LoginActivity(11041): at$KinveySerialExecutor$

08-20 10:10:35.818: E/LoginActivity(11041): at java.util.concurrent.ThreadPoolExecutor.runWorker(

08-20 10:10:35.818: E/LoginActivity(11041): at java.util.concurrent.ThreadPoolExecutor$

08-20 10:10:35.818: E/LoginActivity(11041): at

Again, the above code works when email verification is NOT enforced.

How can I edit the creation request to include the email parameter?

I can confirm that automatic email validation is not working for the Android API 2.6.15.

No solution on this since January??

Sorry for the delay in getting a response for this ticket. I have added the item to the backlog, and will try to get it into the next release.

In the meantime, as a workaround until I get the next version of the library out, you can manually trigger email verification-- I know this isn't ideal, but after a successful creation you can add the "email", call user.update(), and then call user().sendVerificationEmail().

1 person likes this
Login or Signup to post a comment