Skip to main content

signUp

User registration (❗️For providers with user activation, an activation code is sent through the corresponding user notification method)

AuthProvider?.signUp( marker?, body?, langCode? );

Minimal example

const body = {
"formIdentifier": "reg",?
"authData": [?
{
"marker": "login",?
},
{
"marker": "password",?
"value":"12345"?
}
],
"formData": [?
{
"marker": "last_name",?
"type": "string",?
"value": "Name"?
}
],
"notificationData": {?
"phonePush": [?
"+99999999999"
],
"phoneSMS": "+99999999999"?
}
};

const value = await AuthProvider.signUp('email', body)
Schema

marker(required): string
The text identifier of the authorization provider
example: "email"

body(required): ISignUpData
Request body
example:

{
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Name"
}
],
"notificationData": {
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}
}

formIdentifier(required): string
The identifier for the registration form.
example: "reg"

langCode: string
Language code. Default "en_US".

formData(required): IAuthFormData | IAuthFormData[]
The form data for the registration, which can be a single object or an array of objects.
example:

{
"marker": "last_name",
"type": "string",
"value": "Name"
}

marker(required): string
A unique identifier for the form field.
example: "email"

type(required): string
The type of the form field, such as 'string', 'email', etc.
example: "string"

value(required): string
The value entered in the form field.
example: "example@oneentry.cloud"

notificationData(required): Object
An object containing notification data, including email, phonePush, and phoneSMS.
example:

{
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}

langCode: string
Language code. Default: "en_US"
example: "en_US"

Method accepts the body as a parameter.

Examples for body parameter with different types of data:

Example with attributes of simple types formData "string", "integer", "float".

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Fyodor Ivanov"
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attributes of types "date", "dateTime", "time"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "birthday",
"type": "date",
"value": {
"fullDate": "2024-05-07T21:02:00.000Z",
"formattedValue": "08-05-2024 00:02",
"formatString": "DD-MM-YYYY HH:mm"
}
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attribute of type "text"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "text",
"value": {
"htmlValue": "<p>This is me</p>",
"plainValue": "",
"params": {
"isEditorDisabled": false,
"isImageCompressed": true
}
}
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attribute type "textWithHeader"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "textWithHeader",
"value": {
"header": "Header",
"htmlValue": "<p>This is me</p>",
"plainValue": "",
"params": {
"isEditorDisabled": false,
"isImageCompressed": true
}
}
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attributes type "image" and "groupOfImages"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "avatar",
"type": "image",
"value": [
{
"filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"downloadLink": "http://my-site.zone/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"size": 392585,
"previewLink": "",
"params": {
"isImageCompressed": true
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attribute type "file"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "picture",
"type": "file",
"value": [
{
"filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"downloadLink": "http://my-site.zone/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"size": 392585
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attributes type "radioButton" and "list"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "red",
"value": "1",
"extended": {
"value": "red",
"type": "string"
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with attribute type "entity" (nested list)

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "entity-selector",
"type": "entity",
"value": [
{
"id": "1",
"title": "red",
"value": "1",
"parentId": "null"
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Example with one push identifier

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "red",
"value": "1",
"extended": {
"value": "red",
"type": "string"
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [
"7DD987F846400079F4B03C058365A4869047B4A0."
],
"phoneSMS": "+19991234567"
}
}

Example with multiple push identifiers

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "red",
"value": "1",
"extended": {
"value": "red",
"type": "string"
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [
"7DD987F846400079F4B03C058365A4869047B4A0",
"7DD987F846400079F4B03C058365A4869047B4A0",
"7DD987F846400079F4B03C058365A4869047B4A0."
],
"phoneSMS": "+19991234567"
}
}

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Username"
}
],
"notificationData": {
"email": "test@test.com",
"phonePush": [],
"phoneSMS": "+99999999999"
}
}

const value = await AuthProvider.signUp('email', body)
Schema

formIdentifier: string
textual identifier of the authorization provider's form example: reg_form

formData:
form data attached to the authorization provider

authData:
authorization data taken from the form attached to the authorization provider
example:

[ 
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
]

notificationData:
user notification data

attributeSetId: number
identifier for the used attribute set
example: 7

formData: FormDataLangType
Data submitted by the form
example:

{
"en_US": [
{
"marker": "marker_1",
"value": "Name"
}
]
}

notificationData: UserNotificationDataType
data for notifying the user
example:

{ 
"email": "test@test.zone",
"phonePush": "", "phoneSMS": "+19991234567"
}

systemCode: string
system code for performing official actions (password reset, activation)
example:

{ 
"value": "90BDCX",
"expiredDate": "2024-05-07T21:02:00.000Z"
}

formIdentifier: string
the text identifier of the authorization provider's form
example: reg_form

authData: FormAuthDataType
authorization data taken from the form linked to the authorization provider
example:

[ 
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
]

authProviderId: number
ID of the authorization provider
example: 1


This method will register a new user. Returns the registered user's object.

Example return:

{
"id": 1764,
"updatedDate": "2024-05-23T12:43:00.169Z",
"version": 10,
"identifier": "catalog",
"isActive": false,
"authProviderId": 1,
"formData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "f-name",
"value": "Second name"
}
],
"notificationData": {
"email": "test@test.com",
"phonePush": ["+999999999"],
"phoneSMS": "+9999999999"
},
"systemCode": {
"value": "90BDCX",
"expiredDate": "2024-05-07T21:02:00.000Z"
}
}
Schema

id: number
The unique identifier of the sign-up entity.
example: 12345

updatedDate: string
The date when the sign-up entity was last updated.
example: "2023-10-01T12:00:00Z"

version: number
The version number of the sign-up entity.
example: 1

identifier: string
A unique string that identifies the sign-up entity.
example: "signup_12345"

isActive: boolean
Indicates whether the sign-up entity is active.
example: true

notificationData: Object
An object containing notification data, including email, phonePush, and phoneSMS.
example:

{
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}

locale: string
The locale or language code associated with the sign-up entity.
example: "en_US"