udpateProfile

Deprecation Notice

This SDK is deprecated in favor of the Core and UI JS SDKs. See Migrating to the latest SDKs to use the latest Core and UI SDKs.

Support for the Legacy JS SDK ends on 28 February, 2021.

reach5('udpateProfile', {
  accessToken: string,
  redirectUrl: string,
  data: object,
  callback: function,
  // Optional parameters
  fields: object,
})

About this command

Update user’s phone number and send a verification code by SMS.

Examples

reach5('updateProfile', {
  accessToken: 'eyJ0eXAiOiJKV1QiL...',
  redirectUrl: 'https://example-email-validate.com',
  data: {
    givenName: 'John',
    familyName: 'Doe'
  }
}, function(err, user) {
  if (err) {
    // Handle error
    return;
  }
  // do something with user
});

Parameters

accessToken string

User’s access token.

redirectUrl string

The URL the user will be redirected to after clicking on the link contained in the email. This URL must be whitelisted in the Allowed Callback URLs field of your ReachFive client settings.

data object

User profile data

password string

The password of the profile.

email string

The primary email address of the profile.

phoneNumber string

The primary phone number of the profile.

Both the international format and the national conventions of the account’s country are accepted if configured in account settings.

givenName string

The given name of the profile.

middleName string

The middle name of the profile.

familyName string

The family name of the profile.

name string

The full name of the profile.

nickname string

The nickname of the profile.

birthdate string

The birthdate of the profile, represented as an ISO 8601 YYYY-MM-DD format.

profileURL string

The URL of one of the user’s profile page (usually a social provider’s page).

picture string

The URL of one of the profile picture. This URL refers to an image file (PNG, JPEG, or GIF image file).

username string

The username of the profile (the login’s name).

gender string

The gender of the profile.

Allowed values are female, male and other.

company string

The company’s name of the profile.

addresses List of ProfileAddress

The list of the profile’s postal addresses.

locale string

The profile’s language code in lowercase and country code in uppercase, separated by a dash (e.g. en, fr-FR …​).

bio string

The biography of the profile.

customFields Record<string, any>

The custom fields of the profile.

consents Record<string, any>

The consents granted to the profile.

fields string

User’s fields to retrieve in the response. Defaults to id,name,email.

callback string

Event callback that was used with on.