getProfile

client.getProfile(authToken, success, failure)

About this command

Retrieve the profile’s information.

  • The profile must have been granted the profile scope at the last authentication otherwise the profile’s attributes are null.

Examples

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
)

Options

authToken AuthToken

Authorization token of the profile retrieved from login.

idToken string

The ID token JSON Web Token (JWT) that contains the profile’s information.

accessToken string

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

refreshToken string

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

tokenType string

The type of token. Always equal to Bearer.

expiresIn number

The lifetime in seconds of the access token.

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

user OpenIdUser

The user’s information contained in the ID token.

success function

Callback called once the fetch has succeeded. You’ll get the Profile as an argument.

failure function

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

Response

Type: Unit

Profile

id string

The ReachFive identifier of the profile.

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

externalId string

The external identifier of the profile.

authTypes String[]

The list of the authentication providers used to login by the profile (e.g. facebook, password …​).

loginSummary LoginSummary

The login activities history of the profile.

firstLogin string

The time of the first login.

lastLogin string

The time of the last login.

total string

The number of login.

origins string

Some additional information about the login.

devices string

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

lastProvider string

The last provider used for login (e.g. local, lite, facebook …​).

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.

email string

The primary email address of the profile.

emailVerified boolean

true if the profile’s e-mail address has been verified; otherwise false.

emails Emails

The e-mail addresses of the profile.

verified string[]

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

unverified string[]

The list of the unverified e-mail addresses 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.

phoneNumberVerified boolean

true if the user’s phone number has been verified; otherwise false.

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

title string

The title of the address.

This value can’t be an empty string.

isDefault boolean

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

Defaults to true.

addressType string

The type of address

Allowed values: delivery or billing.

streetAddress 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 string

The name of the city.

region string

The name of the region.

postalCode string

The zip code.

country string

The name of the country.

This value can’t be an empty string.

deliveryNote string

An additional note from the profile for the delivery.

recipient string

The name of the recipient located at this address.

company string

The name of the company located at this address.

phoneNumber string

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

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 Map<string, any>

The custom fields of the profile.

consents Map<string, Consent>

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

granted boolean

Whether the consent was granted to the profile or not.

consentType boolean

The type of consent.

Allowed values: opt-in opt-out.

date string

The time the consent was last updated.

createdAt string

The time the profile’s information was created.

updatedAt string

The time the profile’s information was last updated.

liteOnly boolean

Whether the profile is LITE only or not.

ReachFiveError

message string

The message of the error.

code string

The HTTP error code.

exception string

The stack trace of the error.

data ReachFiveApiError

Additional data about the error.

error string

The main error message.

errorId string

The identifier of the error.

errorUserMsg string

The user-friendly error message.

This property is translated according to the user’s browser settings. Currently supported languages:
  • de - Deutsch

  • en - English

  • es - Español

  • fr - Français

  • it - Italiano

  • nl - Nederlands

  • ru - Ру́сский (Russian)

errorMessageKey string

The technical error code.

errorDescription string

The technical error message.

errorDetails ReachFiveApiErrorDetails

  • field - The field concerned by the error.

  • message - The message error returned for the field.

Feedback