Register a new user to an existing org

The below code snippet allows registering a user to the existing org without creating a new org.

Last Name of the user, Email Id and Zaaid( Org Id to which the user has to be registered)are the mandatory attributes.

Ensure the following packages are imported:

Copiedimport com.zc.component.users.PlatformType 
import com.zc.component.users.ZCSignUpData
import com.zc.component.users.ZCUser
Copied//Get an instance of the ZCSingUpData object 
ZCSignUpData signUpdetails = ZCSignUpData.getInstance();
//Set the necessary data for signing up
signUpdetails.setPlatformType(PlatformType.WEB);
signUpdetails.userDetail.setEmailId("santhosh.suresh+sdkuserAdd2@zohocorp.com");
signUpdetails.userDetail.setLastName("Suresh");
signUpdetails.userDetail.setZaaid("");
//Register the user using singUpdetails
signUpdetails = ZCUser.getInstance().addUser(signUpdetails);