Skip to main content

updateUser

Updating a single user object 🔐 This method requires authorization.

Users.updateUser(body, langCode)

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Username"
}
],
"notificationData": {
"email": "example@oneentry.cloud",
"phonePush": ["+99999999999"],
"phoneSMS": "+99999999999"
},
"state": {
"orderCount": 1
}
}

const value = await Users.updateUser(body)
Schema

body:* object
Request body
example:

langCode: string
Optional language field
example: en_US


Schema (body)

formIdentifier string
the text identifier of the form linked to the authorization provider
example: , regForm

formData: FormDataLangType
the data of the form linked to the authorization provider
example:

{
"en_US": [
{
"marker": "first-name",
"value": "First name"
},
{
"marker": "last-name",
"value": "Second name"
}
]
}

authData FormDataType
Authorization data taken from the form linked to the authorization provider (used only to change the password)
example:

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

notificationData UserNotificationDataType
Data for notifying the user
example:

{
"email": "<example@oneentry.cloud>",
"phonePush": "",
"phoneSMS": "+9999999999"
}

This method updates the authorized user's data object. Returns true (in case of successful update) or false (in case of unsuccessful update).

Example return:

true