Aller au contenu principal

signUp

Inscription de l'utilisateur (❗️Pour les fournisseurs avec activation de l'utilisateur, le code d'activation est envoyé par le biais de la méthode de notification correspondante)

AuthProvider.signUp(marker, body, langCode)

Schéma

marker:* chaîne
L'identifiant textuel du fournisseur d'autorisation
exemple : email

body:* ISignUpData
Corps de la requête
exemple :

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

langCode: chaîne
Code de langue
exemple : en_US

La méthode accepte le corps comme paramètre.

Exemples pour le paramètre corps avec différents types de données :

Exemple avec des attributs de types simples formData "string", "integer", "float".

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

Exemple avec des attributs de types "date", "dateTime", "time"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": {
"en_US": [
{
"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"
}
}

Exemple avec un attribut de type "text"

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

Exemple avec un attribut de type "textWithHeader"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": {
"en_US": [
{
"marker": "about",
"type": "textWithHeader",
"value": {
"header": "En-tête",
"htmlValue": "<p>C'est moi</p>",
"plainValue": "",
"params": {
"isEditorDisabled": false,
"isImageCompressed": true
}
}
}
]
},
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}

Exemple avec des attributs de type "image" et "groupOfImages"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": {
"en_US": [
{
"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"
}
}

Exemple avec un attribut de type "file"

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": {
"en_US": [
{
"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"
}
}

Exemple avec des attributs de type "radioButton" et "list"

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

Exemple avec un attribut de type "entity" (liste imbriquée)

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

Exemple avec un identifiant de push

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

Exemple avec plusieurs identifiants de push

{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": {
"en_US": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "rouge",
"value": "1",
"extended": {
"value": "rouge",
"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": "Nom d'utilisateur"
}
],
"notificationData": {
"email": "test@test.com",
"phonePush": [],
"phoneSMS": "+99999999999"
}
}

const value = await AuthProvider.signUp('email', body)
Schéma

formIdentifier: chaîne
identifiant textuel du formulaire du fournisseur d'autorisation exemple : reg_form

formData:
données du formulaire attachées au fournisseur d'autorisation

authData:
données d'autorisation provenant du formulaire attaché au fournisseur d'autorisation
exemple :

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

notificationData:
données de notification de l'utilisateur

attributeSetId: nombre
identifiant pour l'ensemble d'attributs utilisé
exemple : 7

formData: FormDataLangType
Données soumises par le formulaire
exemple :

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

notificationData: UserNotificationDataType
données pour notifier l'utilisateur
exemple :

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

systemCode: chaîne
code système pour effectuer des actions officielles (réinitialisation de mot de passe, activation)
exemple :

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

formIdentifier: chaîne
l'identifiant textuel du formulaire du fournisseur d'autorisation
exemple : reg_form

authData: FormAuthDataType
données d'autorisation provenant du formulaire lié au fournisseur d'autorisation
exemple :

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

authProviderId: nombre
ID du fournisseur d'autorisation
exemple : 1


Cette méthode enregistrera un nouvel utilisateur. Renvoie l'objet de l'utilisateur enregistré.

Exemple de retour :

{
"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": "Deuxième nom"
}
],
"notificationData": {
"email": "test@test.com",
"phonePush": ["+999999999"],
"phoneSMS": "+9999999999"
},
"systemCode": {
"value": "90BDCX",
"expiredDate": "2024-05-07T21:02:00.000Z"
}
}
Schéma

id: nombre
identifiant de l'objet exemple : 1764

updatedDate: chaîne
date de modification de l'objet

version: nombre
numéro de version de l'objet
exemple : 10

identifier: chaîne
identifiant textuel pour l'enregistrement de champ
exemple : catalog
par défaut : marker

attributeSetId: nombre
identifiant pour l'ensemble d'attributs utilisé
exemple : 7

formData: FormDataLangType
Données soumises par le formulaire
exemple :

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

notificationData: UserNotificationDataType
données pour notifier l'utilisateur
exemple:

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

systemCode: chaîne
code système pour effectuer des actions officielles (réinitialisation de mot de passe, activation)
exemple:

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

formIdentifier: chaîne
l'identifiant textuel du formulaire du fournisseur d'autorisation
exemple : reg_form

authData: FormAuthDataType
données d'autorisation provenant du formulaire lié au fournisseur d'autorisation
exemple :

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

authProviderId: nombre
ID du fournisseur d'autorisation
exemple : 1