Add a 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.
Copied//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.
Copied//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 SDK
Copied{
zaid: "1005634498",
user_details: {
zuid: "1005641290",
zaaid: "1005641456",
org_id: "1005641456",
status: "ACTIVE",
is_confirmed: false,
email_id: "p.boylie@zylker.com",
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
}
Copied{
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
}
API Documentation:Add New User - API
Java SDK:Add New User - Java SDK
Node.js SDK:Add New User - Node.js SDK