updateProfile
Description
Update the information of the profile.
|
Examples
import Reach5
let profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login
AppDelegate
.reachfive()
.updateProfile(
authToken: profileAuthToken,
profile: Profile(givenName: "Jonathan", phoneNumber: "+33750253354")
)
.onSuccess { updatedProfile in
// Get the updated profile
}
.onFailure { error in
// Return a ReachFive error
}
Parameters
| Parameter | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Authorization token of the profile retrieved from login.
|
|||||||||||||
The profile with the new data. Only the provided fields will be updated. |
Response
Type: <Profile, ReachFiveError>
Return the profile with the updated data. If parameters are not valid or if the full_write scope is missing, the promise will be rejected and will return a ReachFiveError.
Profile
id |
The ReachFive identifier of the profile. |
||||||||||||
givenName |
The given name of the profile. |
||||||||||||
middleName |
The middle name of the profile. |
||||||||||||
familyName |
The family name of the profile. |
||||||||||||
name |
The full name of the profile. |
||||||||||||
nickname |
The nickname of the profile. |
||||||||||||
birthdate |
The birthdate of the profile, represented as an ISO 8601 |
||||||||||||
profileURL |
The URL of one of the user’s profile page (usually a social provider’s page). |
||||||||||||
picture |
The URL of one of the profile picture. This URL refers to an image file (PNG, JPEG, or GIF image file). |
||||||||||||
externalId |
The external identifier of the profile. |
||||||||||||
authTypes |
The list of the authentication providers used to login by the profile (e.g. facebook, password …). |
||||||||||||
loginSummary |
The login activities history of the profile.
|
||||||||||||
username |
The username of the profile (the login’s name). |
||||||||||||
gender |
The gender of the profile. Allowed values are |
||||||||||||
email |
The primary email address of the profile. |
||||||||||||
emailVerified |
|
||||||||||||
emails |
The e-mail addresses of the profile.
|
||||||||||||
phoneNumber |
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 |
|
||||||||||||
addresses |
The list of the profile’s postal addresses. To get this attribute, the profile must have been granted the
|
||||||||||||
A complementary address field which can contain additional information about the address.
!locality This value can’t be an empty string.
!deliveryNote |
locale |
||||||||||||
The profile’s language code in lowercase and country code in uppercase, separated by a dash (e.g. |
bio |
||||||||||||
The biography of the profile. |
customFields |
||||||||||||
The custom fields of the profile. |
consents |
||||||||||||
The consents granted to the profile. It is a map of string keys with the associated consent object. !===
!granted Allowed values: |
createdAt |
||||||||||||
The time the profile’s information was created. |
updatedAt |
ReachFiveError
Based on the problem, the ReachFiveError will be:
-
RequestError(requestErrors: RequestErrors)if it’s a bad request error.error
stringThe main error message.
errorId
stringThe identifier of the error.
errorUserMsg
stringThe user-friendly error message.
This property is translated according to the user’s browser settings. Currently supported languages: - Currently supported languages
-
-
ar- العربية Arabic -
de- Deutsch German -
en- English -
es- Español Spanish -
fr- Français French -
hu- Magyar Hungarian -
it- Italiano Italian -
jp- 日本 Japanese -
ko- 한국인 Korean -
nl- Nederlands Dutch -
pt- Portuguese -
ru- Ру́сский Russian -
sk- Slovenský Slovak -
zh-CN- People’s Republic of China Simplified Chinese -
zh-Hans- Simplified Chinese -
zh-Hant- Traditional Chinese -
zh-HK- Hong Kong Traditional Chinese -
zh-MO- Macao Traditional Chinese -
zh-SG- Singapore Simplified Chinese -
zh-TW- Taiwan Traditional Chinese
-
errorMessageKey
stringThe error message key.
errorDescription
stringThe technical error message.
errorDetails FieldError[]
field
stringThe field concerned by the error.
message
stringThe message error returned for the
field.code
stringThe code error returned for the
field.-
AuthFailure(reason: String)if the authentication has failed. -
AuthCanceledif the authentication was cancelled. -
TechnicalError(reason: String)if it’s an internal server error.