Add New User

You can add end users to your Catalyst serverless applications, fetch their details, or manage their accounts easily. When a user has signed up to a Catalyst application, unique identification values like ZUID and User ID are created for them. The user is also assigned to an organization automatically in this method.

Create a JSON Configuration

Before you add a new end-user to your Catalyst application, you must create a JSON object that contains the registration details of a particular user, such as their email address, last name, the application platform and the role they must be added to, as shown below. You can then pass the configuration to the user registration method.

Note:
  • You must provide the values for email_id and first_name to register a user mandatorily.
  • You can obtain the role_id from the Roles section in Authentication in the Catalyst console.
    
copy
//Create a JSON object for adding a new user const signupConfig = { platform_type: 'web', template_details: { 'senders_mail':'dogogetu@tutuapp.bid', 'subject':'Welcome to %APP_NAME% ', 'message':'<p>Hello ,</p> <p>Follow this link to join in %APP_NAME% .</p> <p><a href=\'%LINK%\'>%LINK%</a></p> <p>If you didn’t ask to join the application, you can ignore this email.</p> <p>Thanks,</p> <p>Your %APP_NAME% team</p>' 'redirect_url': home.html // The user will be directed to this page once they are authenticated. You can also provide mapped custom domains you configured as your invite URL. }}; var userConfig = { first_name: 'Dannie', last_name: 'Boyle', email_id: 'p.boyle@zylker.com', role_id : '3376000000159024' };

Add a New User

You can now add a new end-user to your Catalyst application using the code below. You must pass the JSON objects you created in the previous section as arguments to the registerUser() method.

The registerUser() method handles the user sign-up process and returns a promise. This promise will be resolved to a JSON object.

The userManagement reference used below is defined in the component instance page.

Note : You will be able to add only 25 users in your application in the development environment. After you deploy your application to production, you can include any number of end-users in it.
    
copy
let userManagement = app.userManagement(); let registerPromise = userManagement.registerUser(signupConfig, userConfig); //Pass the JSON configration to the method registerPromise.then(userDetails => { //Returns a promise console.log(userDetails); });

A sample response that you will receive for each version is shown below:

    
Node JS
copy
{
  zaid: "1005634498",
  user_details: {
    zuid: "1005641290",
    zaaid: "1005641456",
    org_id: "1005641456",
    status: "ACTIVE",
    is_confirmed: false,
    email_id: "p.boylie@zylker.com",
    first_name: "Dannie",
    last_name: "Boyle",
    created_time: "Aug 12, 2021 12:33 PM",
    modified_time: "Aug 12, 2021 12:33 PM",
    invited_time: "Aug 12, 2021 12:33 PM",
    role_details: { role_name: "App User", role_id: "2305000000006024" },   
    user_type: "App User",
    user_id: "2305000000007752",
    project_profiles: []
  },
redirect_url: "https://aliencity-66446133.development.catalystserverless.com/app/",
  platform_type: "web",
  org_id: null
}
{
  zaid: 1005634498,
  user_details: {
    zuid: 1005641433,
    zaaid: 1005641434,
    org_id: 1005641434,
    status: "ACTIVE",
    is_confirmed: false,
    email_id: "p.boyle@zylker.com",
    last_name: "Boyle",
    first_name: "Dannie",
    created_time: "Aug 12, 2021 12:27 PM",
    modified_time: "Aug 12, 2021 12:27 PM",
    invited_time: "Aug 12, 2021 12:27 PM",
  role_details: { role_name: "App User", role_id: 2305000000006024 },
    user_type: "App User",
    user_id: 2305000000007745,
    project_profiles: []
  },
redirect_url: "https://aliencity-66446133.development.catalystserverless.com/app/",
  platform_type: "web",
  org_id: null
}

Last Updated 2024-02-23 16:46:45 +0530 +0530

ON THIS PAGE