Introduction

Below are all the functions accessible via the Android SDK.

In all the code examples below, the Reachfive client is instantiated and stored in a variable named client.

Core commands

exchangeCodeForToken

Exchange an authorization code for an access token

Arguments
  • authorizationCode

    string

    The authorization code.

  • success

    function

    Callback called once the exchange has succeeded. You'll get an authentication token as an argument.

  • failure

    function

    Callback called once the exchange has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the parameters are invalid, the promise will be rejected and will return a ReachFiveError.

Definition
client.signup(profile, scope, success, failure)
Example Request
client.exchangeCodeForToken(
    authorizationCode = "Azc6229cee...",
    success = { authToken -> // Get the profile's authentification token },
    failure = { error -> // Return a ReachFive error }
  )

getProfile

Retrieve the profile's information.

Note: the profile must have been granted the profile scope at the last authentication otherwise the profile's attributes are null.

Arguments
  • authToken

    The authorization token of the profile retrieved from login.

  • success

    function

    Callback called once the fetch has succeded. You'll get the profile as an argument.

  • failure

    function

    Callback called once the fetch has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

Definition
client.getProfile(authToken, success, failure)
Example Request
import com.reach5.identity.sdk.core.models.AuthToken

val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

client.getProfile(
    authToken = profileAuthToken,
    success = { profile -> // Get the profile },
    failure = { error -> // Return a ReachFive error }
)

loginWithPassword

Authenticate the user with the specified identifier (email or phone number) and password.

A user may identify himself with either his email address or his phone number if the SMS feature is enabled.

Arguments
  • username

    string

    The username of the profile. It can be his email address or phone number.

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

  • password

    string

    The password of the profile.

  • scope

    optional Collection of string

    The list of the profile's scopes. Make sure they are allowed by the client.

    Default scopes are the allowed scopes set up in the client's configuration.

  • success

    function

    Callback called once the login has succeded. You'll get an authentication token as an argument.

  • failure

    function

    Callback called once the login has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the credentials are invalid, the promise will be rejected and will return a ReachFiveError.

Definition
client.loginWithPassword(username, password, scope, success, failure)
Example Request
// Login with an email
client.loginWithPassword(
  username = "john.doe@gmail.com",
  password = "UCrcF4RH",
  scope = listOf("openid", "profile", "email"),
  success = { authToken -> // Get the profile's authentification token },
  failure = { error -> // Return a ReachFive error }
)

// Login with a phone number
client.loginWithPassword(
  username = "+33682234940",
  password = "UCrcF4RH",
  scope = listOf("openid", "profile", "phone"),
  success = { authToken -> // Get the profile's authentification token },
  failure = { error -> // Return a ReachFive error }
)

loginWithProvider

Authenticate the user with a social provider (Facebook, Google ...)

Refer to the Android SDK Installation to initialize the providers at the client's instantiation.

Notes: the scopes provided are the permissions setup in the provider's configuration through the console.

Arguments
  • name

    string

    The name of the provider.

  • origin

    string

    The origin of the call.

  • activity

    Activity

    The Android activity.

Response

Type: Promise[void]

Definition
client.loginWithProvider(name, origin, activity)
Example Request
import android.support.v7.app.AppCompatActivity
import com.reach5.identity.sdk.core.ReachFive

class MainActivity : AppCompatActivity() {
  // List the providers created on your ReachFice client
  val providers = ReachFive.getProviders()[0]

  client.loginWithProvider(providers[0].name, "home", this)
}

logout

Kill the SSO session of the profile.

Arguments
  • successWithNoContent

    function

    Callback called once the password reset request has succeded. No argument is expected.

  • failure

    function

    Callback called once the password reset request has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

Definition
client.logout(successWithNoContent, failure)
Example Request
client.logout(
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

refreshAccessToken

Obtain a new AuthToken once your access token has expired.

Notes:

  • An expired access token (short-lived) can be renewed using a refresh token (long-lived).
  • Refreshing access tokens using a revoked refresh token fails and invalidates the current refresh token.
  • The profile must have been granted the offline_access scope at the last authentication in order to obtain a refresh token.
  • In order for a refresh token to be included in your AuthToken, your client must be configured on the ReachFive console to enforce PKCE and to enable refresh tokens.
Arguments
  • authToken

    The authorization token of the profile retrieved from login.

  • success

    function

    Callback called once token refresh has succeded. You'll get an authentication token as an argument, which contains your newly refreshed access token.

  • failure

    function

    Callback called if token fresh has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the refresh token is invalid, the promise will be rejected and will return a ReachFiveError.

Definition
client.refreshAccessToken(authToken, success, failure)
Example Request
import com.reach5.identity.sdk.core.models.AuthToken

val authToken: AuthToken = // The authentification token obtained from login or signup.

client.refreshAccessToken(
  authToken = authToken,
  success = { authToken -> // Get a new authentification token },
  failure = { error -> // Return a ReachFive error }
)

requestPasswordReset

Request a password reset for a profile. It will send an email if the email address is provided and an SMS if the phone number is given.

It is required to configure and to enable the Password reset email or the Password reset SMS templates in the account's settings.

Arguments
  • email

    optional string

    The email address of the profile.

  • redirectUrl

    optional string

    The URL sent in the reset password email to which the profile is redirected.

  • phoneNumber

    optional string

    The 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.

  • successWithNoContent

    function

    Callback called once the password reset request has succeded. No argument is expected.

  • failure

    function

    Callback called once the password reset request has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the identifier is invalid or if the templates are incomplete, the promise will be rejected and will return a ReachFiveError. Otherwise, the profile will receive an email or an SMS.

Definition
client.requestPasswordReset(email, redirectUrl, phoneNumber, successWithNoContent, failure)
Example Request
// Send an email
client.requestPasswordReset(
    email = "john.doe@gmail.com",
    redirectUrl = "https://example-password-reset.com"
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

// Send an SMS
client.requestPasswordReset(
    phoneNumber = "+33682234940",
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

signup

Create and authenticate a new user with the specified data.

A user may identify himself with either his email address or his phone number if the SMS feature is enabled.

Arguments
  • The data of the profile.

  • scope

    optional Collection of string

    The list of the profile's scopes. Make sure they are allowed by the client.

    Default scopes are the allowed scopes set up in the client's configuration.

  • success

    function

    Callback called once the signup has succeeded. You'll get an authentication token as an argument.

  • failure

    function

    Callback called once the signup has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the parameters are invalid or if a profile already exists with the same email address, the promise will be rejected and will return a ReachFiveError.

Definition
client.signup(profile, scope, success, failure)
Example Request
import com.reach5.identity.sdk.core.models.Profile

client.signup(
    Profile(
        givenName = "Jonh",
        familyName = "Doe",
        gender = "male",
        email = "john.doe@gmail.com",
        password = "hjk90wxc"
    ),
    scope = listOf("openid", "profile", "email"),
    success = { authToken -> // Get the profile's authentification token },
    failure = { error -> // Return a ReachFive error }
  )

startPasswordless

Starts passwordless flow by sending an email or a sms to the user with a single-use auth code.

Arguments
  • email

    optional string

    The email of the user.

  • phoneNumber

    optional string

    The phone number of the user.

  • redirectUrl

    string

    The URL where the user will be redirected after the passwordless success.

  • success

    successWithNoContent

    Callback called once the email/sms has been sent. No argument is expected.

  • failure

    function

    Callback called once the passwordless failed to start. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the parameters are invalid the promise will be rejected and will return a ReachFiveError.

Definition
client.startPasswordless(email, phoneNumber, successWithNoContent, failure)
Example Request
import com.reach5.identity.sdk.core.models.Profile

// Email passwordless
client.startPasswordless(
    email = "john.doe@email.com",
    redirectUrl = "reachfive://callback",
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
  )

// Sms passwordless
client.startPasswordless(
    phoneNumber = "+33612345678",
    redirectUrl = "reachfive://callback",
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
  )

updateEmail

Update the profile's email address and send a verification email.

Notes:

  • The profile must have been granted the full_write scope at the last authentication.
  • It is required to configure and to enable the Verification email template in the account's settings.
Arguments
  • authToken

    The authorization token of the profile retrieved from login.

  • email

    string

    The email address of the profile. The new email address must be different from the old one.

  • redirectUrl

    optional string

    The URL sent in the verification email to which the profile is redirected.

  • success

    function

    Callback called once the update has succeeded. You'll get the updated profile as an argument.

  • failure

    function

    Callback called once the update has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

The promise will be rejected and will return a ReachFiveError if:

  • the parameters are invalid,
  • the full_write scope is missing,
  • the email template is incomplete.
Definition
client.updateEmail(authToken, email, redirectUrl, success, failure)
Example Request
import com.reach5.identity.sdk.core.models.AuthToken

val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

client.updateEmail(
    authToken = profileAuthToken,
    email = "johnatthan.doe@gmail.com",
    redirectUrl = "https://example-email-update.com"
    success = { updatedProfile -> // Get the updated profile },
    failure = { error -> // Return a ReachFive error }
)

updatePassword

Update the profile's password. The parameters required in addition to the new password are either:

  • a fresh access token (less than 5 minutes old).
  • an access token and the old password.
  • the profile's email address/phone number and the verification code sent by email/SMS through a request password reset flow.

Notes: the profile must have been granted the full_write scope at the last authentication.

Arguments
  • updatePasswordRequest

    The parameters required to update the profile's password.

  • successWithNoContent

    function

    Callback called once the verification has succeded. No argument is expected.

  • failure

    function

    Callback called once the verification has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

The promise will be rejected and will return a ReachFiveError if the parameters are invalid or if the full_write scope is missing.

Definition
client.updatePassword(updatePasswordRequest, successWithNoContent, failure)
Example Request
import com.reach5.identity.sdk.core.models.AuthToken
import com.reach5.identity.sdk.core.models.requests.UpdatePasswordRequest.*

// Update the password with a fresh access token
val freshProfileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login (less than 5 min)
client.updatePassword(
    updatePasswordRequest = UpdatePasswordRequest.FreshAccessTokenParams(freshProfileAuthToken, "ZPf7LFtc"),
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

// Update the password by providing the old one
client.updatePassword(
    updatePasswordRequest = UpdatePasswordRequest.AccessTokenParams(profileAuthToken, "gVc7piBn", "ZPf7LFtc"),
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

// Update the password with a verification code retrieved from an email
client.updatePassword(
    updatePasswordRequest = UpdatePasswordRequest.EmailParams("john.doe@example.com", "234", "ZPf7LFtc"),
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

// Update the password with a verification code retrieved from an SMS
client.updatePassword(
    updatePasswordRequest = UpdatePasswordRequest.SmsParams("+33682234940", "234", "ZPf7LFtc"),
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

updatePhoneNumber

Update the profile's phone number and send a verification code by SMS.

Notes:

  • The profile must have been granted the full_write scope at the last authentication.
  • It is required to configure and to enable the Verification SMS template in the account's settings.
Arguments
  • authToken

    The authorization token of the profile retrieved from login.

  • phoneNumber

    string

    The phone number of the profile. The new phone number can be identical to the old one.

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

  • success

    function

    Callback called once the update has succeeded. You'll get the updated profile as an argument.

  • failure

    function

    Callback called once the update has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

The promise will be rejected and will return a ReachFiveError if:

  • the parameters are invalid,
  • the full_write scope is missing,
  • the SMS template is incomplete.
Definition
client.updatePhoneNumber(authToken, phoneNumber, success, failure)
Example Request
import com.reach5.identity.sdk.core.models.AuthToken

val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

client.updatePhoneNumber(
    authToken = profileAuthToken,
    phoneNumber = "+33792244940",
    success = { updatedProfile -> // Get the updated profile },
    failure = { error -> // Return a ReachFive error }
)

updateProfile

Update the information of the profile.

Notes:

  • The profile must have been granted the full_write scope at the last authentication.
  • The email and the password fields of the profile can't be updated with this method, except if the profile has no email address (generally when it is not provided by the social provider). Use instead the updateEmail method.
  • The phoneNumber field of the profile can't be updated if the SMS verification code is disabled on the account settings.
Arguments
  • authToken

    The authorization token of the profile retrieved from login.

  • profile

    The profile with the new data. Only the provided fields will be updated.

  • success

    function

    Callback called once the update has succeded. You'll get the updated profile as an argument.

  • failure

    function

    Callback called once the update has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the parameters are invalid or if the full_write scope is missing, the promise will be rejected and will return a ReachFiveError.

Definition
client.updateProfile(authToken, profile, success, failure)
Example Request
import com.reach5.identity.sdk.core.models.Profile
import com.reach5.identity.sdk.core.models.AuthToken

val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

client.updateProfile(
    authToken = profileAuthToken,
    profile = Profile(givenName = "Jonhatthan", phoneNumber = "+33750253354"),
    success = { updatedProfile -> // Get the updated profile },
    failure = { error -> // Return a ReachFive error }
)

verifyPasswordless

Verify the user's verification code sent by sms.

Arguments
  • phoneNumber

    string

    The phone number of the user.

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

  • verificationCode

    string

    The verification code sent by SMS.

  • success

    function

    Callback called once verify passwordless has succeded. You'll get an authentication token as an argument, which contains your newly refreshed access token.

  • failure

    function

    Callback called once the verification has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the verification code is incorrect, the promise will be rejected and will return a ReachFiveError.

Definition
client.verifyPasswordless(phoneNumber, verificationCode, success, failure)
Example Request
client.verifyPhoneNumber(
    phoneNumber = "+33712345678",
    verificationCode = "9876543210",
    success = { authToken -> // Get a new authentification token },
    failure = { error -> // Return a ReachFive error }
)

verifyPhoneNumber

Verify the profile's phone number with the verification code sent by SMS after signup.

Note: the profile must have been granted the full_write scope at the last authentication.

Arguments
  • authToken

    The authorization token of the profile retrieved from login.

  • phoneNumber

    string

    The 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.

  • verificationCode

    string

    The verification code sent by SMS.

  • successWithNoContent

    function

    Callback called once the verification has succeded. No argument is expected.

  • failure

    function

    Callback called once the verification has failed. You'll get a ReachFiveError as an argument.

Response

Type: Promise[void]

If the full_write scope is missing or if the verification code is incorrect, the promise will be rejected and will return a ReachFiveError.

Definition
client.verifyPhoneNumber(authToken, phoneNumber, verificationCode, successWithNoContent, failure)
Example Request
import com.reach5.identity.sdk.core.models.AuthToken

val profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login

client.verifyPhoneNumber(
    authToken = profileAuthToken,
    phoneNumber = "+33750253354",
    verificationCode = "501028",
    successWithNoContent = { _ -> // Do something },
    failure = { error -> // Return a ReachFive error }
)

Models

AuthToken

Attributes
  • idToken

    optional string

    The ID token (Json Web Token) that contains the profile's information.

  • accessToken

    string

    The authorization credential (Json Web Token) used to access the ReachFive API.

  • refreshToken

    string

    The refresh token (Json Web Token) used to obtain new access tokens once they expire.

  • tokenType

    optional string

    The type of token. Always equal to Bearer.

  • expiresIn

    optional number

    The lifetime in seconds of the access token.

    If expiresIn is below or equal to 0, the AuthToken is expired.

  • user

    optional OpenIdUser

    The user's information contained in the ID token.

Emails

Attributes
  • verified

    optional List of string

    The list of the verified e-mail addresses of the profile.

  • unverified

    optional List of string

    The list of the unverified e-mail addresses of the profile.

LoginSummary

Attributes
  • firstLogin

    optional long

    The time of the first login.

  • lastLogin

    optional long

    The time of the last login.

  • total

    optional int

    The number of login.

  • origins

    optional List of string

    Some additional information about the login.

  • devices

    optional List of string

    The devices used for login (eg desktop, ios, android, mobile_web and windows_phone).

  • lastProvider

    optional string

    The last provider used for login (eg local, lite, facebook ...).

OpenIdUser

User information specified by OpenId Connect.

Attributes
  • id

    optional string

    The identifier of the user.

  • name

    optional string

    The full name of the user in displayable form including all name parts, possibly including titles and suffixes, ordered according to the user's locale and preferences.

  • preferredUsername

    optional string

    The shorthand name by which the user wishes to be referred to.

  • givenName

    optional string

    The given name or first name of the user.

  • familyName

    optional string

    The surname or last name of the user.

  • middleName

    optional string

    The middle name of the user.

  • nickname

    optional string

    The casual name of the user that may or may not be the same as the givenName.

  • picture

    optional string

    The URL of the user's profile picture.

  • website

    optional string

    The URL of the user's web page or blog.

  • email

    optional string

    The user's preferred e-mail address.

  • emailVerified

    optional boolean

    True if the user's e-mail address has been verified; otherwise false.

  • gender

    optional string

    The user's gender.

  • zoneinfo

    optional string

    The sring from zoneinfo time zone database representing the user's time zone.

  • locale

    optional string

    The user's language code in lowercase and country code in uppercase, separated by a dash.

  • phoneNumber

    optional string

    The user's preferred telephone number.

  • phoneNumberVerified

    optional boolean

    True if the user's phone number has been verified; otherwise false.

  • address

    optional string

    The user's preferred postal address.

  • birthdate

    optional string

    The user's birthday, represented as an YYYY-MM-DD format.

Profile

Attributes
  • uid

    optional string

    The ReachFive identifier of the profile.

  • givenName

    optional string

    The given name of the profile.

  • middleName

    optional string

    The middle name of the profile.

  • familyName

    optional string

    The family name of the profile.

  • name

    optional string

    The full name of the profile.

  • nickname

    optional string

    The nickname of the profile.

  • birthdate

    optional string

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

  • profileURL

    optional string

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

  • picture

    optional string

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

  • externalId

    optional string

    The external identifier of the profile.

  • authTypes

    optional List of string

    The list of the authentication providers used to login by the profile (eg facebook, password ...).

  • loginSummary

    optional LoginSummary

    The login activities history of the profile.

  • username

    optional string

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

  • gender

    optional string

    The gender of the profile.

    Allowed values are female, male and other.

  • email

    optional string

    The primary email address of the profile.

  • emailVerified

    optional boolean

    True if the profile's e-mail address has been verified; otherwise false.

  • emails

    optional Emails

    The e-mail addresses of the profile.

  • phoneNumber

    optional 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.

  • phoneNumberVerified

    optional boolean

    True if the user's phone number has been verified; otherwise false.

  • addresses

    optional List of ProfileAddress

    The list of the profile's postal addresses.

    To get this attribute, the profile must have been granted the address scope at the last authentication.

  • locale

    optional string

    The profile's language code in lowercase and country code in uppercase, separated by a dash (eg en, fr-FR ...).

  • bio

    optional string

    The biography of the profile.

  • customFields

    optional Map<string, any>

    The custom fields of the profile.

  • consents

    optional Map<string, Consent>

    The consents granted to the profile. It is a map of string keys with the associated consent object.

  • tosAcceptedAt

    optional string

    The time the profile accepted the terms of service.

  • createdAt

    optional string

    The time the profile's information was created.

  • updatedAt

    optional string

    The time the profile's information was last updated.

  • liteOnly

    optional boolean

    Whether the profile is LITE only or not.

  • company

    optional string

    The company's name of the profile.

ProfileAddress

Attributes
  • title

    optional string

    The title of the address.

    This value can't be an empty string.

  • isDefault

    optional boolean

    Whether the address is the default postal address of the profile. Only a single address can be the default address.

    Default: true.

  • addressType

    The type of address.

  • streetAddress

    optional string

    The full street address component which may include the house number, the street's name and the extended street address information separated by newlines.

    This value can't be an empty string.

  • locality

    optional string

    The name of the city.

  • region

    optional string

    The name of the region.

  • postalCode

    optional string

    The zip code.

  • country

    optional string

    The name of the country.

    This value can't be an empty string.

  • deliveryNote

    optional string

    An additional note from the profile for the delivery.

  • recipient

    optional string

    The name of the recipient located at this address.

  • company

    optional string

    The name of the company located at this address.

  • phoneNumber

    optional string

    The phone number of the contact point at this address (no format validation is required).

ProfileAddressType

Enum class with the following constants: billing or delivery

ProfileSignupRequest

Attributes
  • password

    string

    The password of the profile. Password must meet the minimum requirements defined by the library used.

  • email

    optional string

    The primary email address of the profile.

  • phoneNumber

    optional 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

    optional string

    The given name of the profile.

  • middleName

    optional string

    The middle name of the profile.

  • familyName

    optional string

    The family name of the profile.

  • name

    optional string

    The full name of the profile.

  • nickname

    optional string

    The nickname of the profile.

  • birthdate

    optional string

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

  • profileURL

    optional string

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

  • picture

    optional string

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

  • username

    optional string

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

  • gender

    optional string

    The gender of the profile.

    Allowed values are female, male and other.

  • company

    optional string

    The company's name of the profile.

  • addresses

    optional List of ProfileAddress

    The list of the profile's postal addresses.

  • locale

    optional string

    The profile's language code in lowercase and country code in uppercase, separated by a dash (eg en, fr-FR ...).

  • bio

    optional string

    The biography of the profile.

  • customFields

    optional Map<string, any>

    The custom fields of the profile.

  • consents

    optional Map<string, Consent>

    The consents granted to the profile. It is a map of string keys with the associated consent object.

  • tosAcceptedAt

    optional string

    The time the profile accepted the terms of service.

  • liteOnly

    optional boolean

    Whether the profile is LITE only or not.

ReachFiveApiError

Attributes
  • error

    string

    The main error message.

  • errorId

    optional string

    The identifier of the error.

  • errorUserMsg

    optional string

    The user-friendly error message.

  • errorDescription

    optional string

    The technical error message.

  • errorDetails

    optional List of ReachFiveApiErrorDetails

    More details about the error.

ReachFiveApiErrorDetail

Attributes
  • field

    string

    The field concerned by the error.

  • message

    string

    The message error return for the field.

ReachFiveError

Attributes
  • message

    string

    The message of the error.

  • code

    optional integer

    The HTTP error code.

  • exception

    optional Exception

    The stackstrace of the error.

  • data

    Additional data about the error.

Example
{
    "message": "invalid_request",
    "code": 400,
    "exception": null,
    "data": {
        "error": "invalid_request",
        "errorId": "9W3kyNfEZN",
        "errorUserMsg": null,
        "errorDescription": "Validation failed",
        "errorDetails": [
            {
                "field": "data.email",
                "message": "Must be a valid email"
            }
        ]
    }
}

{
    "message": "email_already_exists",
    "code": 400,
    "exception": null,
    "data": {
        "error": "email_already_exists",
        "errorId": "b6tafffEBV",
        "errorUserMsg": "Another account with the same email address already exists",
        "errorDescription": "Email already in use",
        "errorDetails": null
    }
}

UpdatePasswordRequest.AccessTokenParams

Attributes
  • authToken

    The authorization token of the profile retrieved from login.

  • oldPassword

    string

    The old password of the profile.

  • password

    string

    The new password of the profile. Password must meet the minimum requirements defined by the library used. It must also be different from the old one.

UpdatePasswordRequest.EmailParams

Attributes
  • email

    string

    The email address of the profile.

  • verificationCode

    string

    The verification code sent by email.

  • password

    string

    The new password of the profile. Password must meet the minimum requirements defined by the library used. It must also be different from the old one.

UpdatePasswordRequest.FreshAccessTokenParams

Attributes
  • freshAuthToken

    The authorization token of the profile retrieved from login (less than 5 minutes old).

  • password

    string

    The new password of the profile. Password must meet the minimum requirements defined by the library used. It must also be different from the old one.

UpdatePasswordRequest.SmsParams

Attributes
  • phoneNumber

    string

    The 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.

  • verificationCode

    string

    The verification code sent by SMS.

  • password

    string

    The new password of the profile. Password must meet the minimum requirements defined by the library used. It must also be different from the old one.