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 userID are created for them. The user is also assigned to an organization by Catalyst. You can learn more about this from the Users help page.
You can use the following code snippet to register a new user to access your Catalyst application. This registration process is handled using the signUp() method. The auth reference used in the code snippet below is defined in the auth instance page. You must provide the email address and last name to register of the user mandatorily while adding the user.
The JSON objects containing the registration details of a particular user are created as shown below.
copy//Enter the first name, last name, email id, platform and the redirect url var data = { "first_name": "Jason", "last_name": "Chang", "email_id": "jason.c@zylker.com", "platform_type": "web", "redirect_url": "https://shipmenttracking.zylker.com/" };
This object is passed as an argument to the signUp() method. The promise returned here will be resolved to an object whose content key contains details of the registered user.
copy//Register the user by passing the object This in turn returns a promise var auth = catalyst.auth; var signupPromise = auth.signUp(data); signupPromise .then((response) => { console.log(response.content); }) .catch((err) => { console.log(err); });
A sample response that you will receive for each version is shown below:
Web SDKcopy
{
zaid: "1005634498",
user_details: {
zuid: "1005641290",
zaaid: "1005641456",
org_id: "1005641456",
status: "ACTIVE",
is_confirmed: false,
email_id: "p.boylie@zylker.com",
first_name: "loki",
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: "10103000000115016"
},
user_type: "App User",
source: "Email",
user_id: "10103000000111308"
},
redirect_url: "https://aliencity-66446133.development.catalystserverless.com/app/",
platform_type": "web",
org_id: "10062221186"
}
{
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",
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 2023-11-14 13:20:49 +0530 +0530
Yes
No
Send your feedback to us