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:
-
AuthCanceled
: The user cancelled the request or no credential was available in the keychain. -
RequestError(apiError: ApiError)
for a Bad Request (status 400) error. -
AuthFailure(reason: String, apiError: ApiError?)
mainly for Unauthorized (status 401) error. -
TechnicalError(reason: String, apiError: ApiError?)
if it’s an Internal Server Error (status 500) or other internal errors.
ApiError
error |
The main error message. |
||||||
errorId |
The identifier of the error. |
||||||
errorUserMsg |
The user-friendly error message.
|
||||||
errorMessageKey |
The error message key. |
||||||
errorDescription |
The technical error message. |
||||||
errorDetails FieldError[] |
|