Saltar al contenido principal

signUp

Registro de usuario (❗️Para proveedores con activación de usuario, se envía un código de activación a través del método de notificación correspondiente)

Descripción

El método acepta el cuerpo como un parámetro. Devuelve una Promesa que se resuelve en un objeto ISignUpEntity.

AuthProvider.signUp(

marker*, body*, formIdentifier*, langCode, formData

);

Esquema de parámetros

Esquema

marker(required): string
El identificador de texto del proveedor de autorización
ejemplo: "email"

body(required): ISignUpData
Cuerpo de la solicitud
ejemplo:

{
"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"
}
}

body.formIdentifier(required): string
El identificador del formulario de registro.
ejemplo: "reg"

body.langCode: string
Código de idioma. Por defecto "en_US".

body.formData(required): IAuthFormData | IAuthFormData[]
Los datos del formulario para el registro, que pueden ser un solo objeto o un array de objetos.
ejemplo:

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

formData.marker(required): string
Un identificador único para el campo del formulario.
ejemplo: "email"

formData.type(required): string
El tipo del campo del formulario, como 'string', 'email', etc.
ejemplo: "string"

formData.value(required): string
El valor ingresado en el campo del formulario.
ejemplo: "example@oneentry.cloud"

body.notificationData(required): Object
Un objeto que contiene datos de notificación, incluyendo email, phonePush y phoneSMS.
ejemplo:

{
"email": "example@oneentry.cloud", // Campo de notificaciones por email. Requerido.
"phonePush": [
"+99999999999"
], // Campo de notificaciones push. Opcional.
"phoneSMS": "+99999999999" // Campo de notificaciones SMS. Opcional.
}

langCode: string
Código de idioma. Por defecto: "en_US"
ejemplo: "en_US"

Ejemplos

Ejemplo mínimo



const body = {
"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"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributos de tipos simples formData "string", "integer", "float".

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Fyodor Ivanov"
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributos de tipos "date", "dateTime", "time"

const body = {
"formIdentifier": "reg",
"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": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributo de tipo "text"

Para un valor de campo de texto, puedes usar uno de los tres tipos de valor:

  • htmlValue - cadena HTML
  • plainValue - cadena
  • mdValue - cadena Markdown
const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "text",
"value": {
"htmlValue": "<p>Este soy yo</p>",
// "plainValue": "",
// "mdValue": ""
}
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributo tipo "textWithHeader"

Para un valor de campo textWithHeader, puedes usar uno de los tres tipos de valor:

  • htmlValue - cadena HTML
  • plainValue - cadena
  • mdValue - cadena Markdown
const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "textWithHeader",
"value": {
"header": "Encabezado",
"htmlValue": "<p>Este soy yo</p>",
// "plainValue": "",
// "mdValue": ""
}
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributos tipo "image" y "groupOfImages"

Si se proporciona un objeto fileQuery en el objeto formData, el archivo se cargará automáticamente en la nube de OneEntry a través del SDK o usa el manejador File.uploadFile() Ver ejemplo

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "image",
type: "image",
value: [file],
fileQuery: {
type: "page",
entity: "editor",
id: 3492,
},
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributo tipo "file"

Si se proporciona un objeto fileQuery en el objeto formData, el archivo se cargará automáticamente en la nube de OneEntry a través del SDK o usa el manejador File.uploadFile() Ver ejemplo

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "image",
type: "image",
value: [file],
fileQuery: {
type: "page",
entity: "editor",
id: 3492,
},
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributos tipo "radioButton" y "list"

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "list",
type: "list",
value: ["1"],
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo con atributo tipo "entity" (lista anidada)

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "entity",
type: "entity",
value: [2954, 2957],
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Ejemplo de respuesta

{
"createdDate": "2025-12-26T12:17:46.115Z",
"deletedAt": null,
"formData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "f-name",
"value": "Segundo nombre"
}
],
"id": 286,
"identifier": "user_email@gmail.com",
"isActive": false,
"isDeleted": false,
"locale": "en_US",
"notificationData": {
"email": "user_email@gmail.com"
},
"email": "user_email@gmail.com",
"state": {},
"updatedDate": "2025-12-26T12:17:46.115Z",
"version": 0
}

Esquema de respuesta

Esquema: ISignUpEntity

id: number
El identificador único de la entidad de registro.
ejemplo: 12345

updatedDate: string
La fecha en que se actualizó por última vez la entidad de registro.
ejemplo: "2023-10-01T12:00:00Z"

version: number
El número de versión de la entidad de registro.
ejemplo: 1

identifier: string
Una cadena única que identifica la entidad de registro.
ejemplo: "signup_12345"

isActive: boolean
Indica si la entidad de registro está activa.
ejemplo: true

notificationData: object
Un objeto que contiene datos de notificación, incluyendo email, phonePush y phoneSMS.
ejemplo:

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

locale: string
El código de idioma o local asociado con la entidad de registro.
ejemplo: "en_US"